|
|
@@ -1,20 +1,26 @@
|
|
|
package com.dk.mdm.service.mst;
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.dk.common.infrastructure.annotaiton.Pagination;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
+import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
-import com.dk.mdm.infrastructure.convert.mst.StaffConvert;
|
|
|
-import com.dk.mdm.mapper.mst.StaffMapper;
|
|
|
+import com.dk.mdm.infrastructure.convert.mst.MoneyAccountConvert;
|
|
|
import com.dk.mdm.model.pojo.mst.MoneyAccount;
|
|
|
import com.dk.mdm.mapper.mst.MoneyAccountMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
|
import com.dk.common.mapper.BaseMapper;
|
|
|
+import com.dk.mdm.model.pojo.mst.Staff;
|
|
|
import com.dk.mdm.model.query.mst.MoneyAccountQuery;
|
|
|
import com.dk.mdm.model.response.mst.MoneyAccountResponse;
|
|
|
+import com.dk.mdm.model.vo.mst.MoneyAccountVO;
|
|
|
+import com.dk.mdm.model.vo.mst.StaffVO;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
+import java.util.UUID;
|
|
|
+
|
|
|
@Service
|
|
|
@Transactional
|
|
|
public class MoneyAccountService extends BaseService<MoneyAccount> {
|
|
|
@@ -27,6 +33,9 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
|
|
|
@Autowired
|
|
|
private MoneyAccountMapper moneyAccountMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private MoneyAccountConvert moneyAccountConvert;
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 重写主键
|
|
|
* @author : songy
|
|
|
@@ -34,18 +43,48 @@ public class MoneyAccountService extends BaseService<MoneyAccount> {
|
|
|
*/
|
|
|
@Override
|
|
|
public String getPrimaryKey() {
|
|
|
- return "staff_id";
|
|
|
+ return "moneyAccount_id";
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* @desc : 条件查询
|
|
|
* @author : songy
|
|
|
- * @date : 2023/1/9 10:40
|
|
|
+ * @date : 2023/2/29 10:40
|
|
|
*/
|
|
|
@Pagination
|
|
|
public ResponseResultVO<PageList<MoneyAccountResponse>> selectByCond(MoneyAccountQuery moneyAccountQuery) {
|
|
|
return super.mergeListWithCount(moneyAccountQuery, moneyAccountMapper.selectByCond(moneyAccountQuery),
|
|
|
moneyAccountMapper.countByCond(moneyAccountQuery));
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 保存方法
|
|
|
+ * @author : songy
|
|
|
+ * @date : 2023/2/29 10:49
|
|
|
+ */
|
|
|
+ @Transactional(
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
+ )
|
|
|
+ public ResponseResultVO<?> insert(MoneyAccountVO moneyAccountVO) {
|
|
|
+ // 转化实体
|
|
|
+ MoneyAccount moneyAccount = moneyAccountConvert.convertToPo(moneyAccountVO);
|
|
|
+
|
|
|
+ return super.insert(moneyAccount);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @desc : 编辑方法
|
|
|
+ * @author : songy
|
|
|
+ * @date : 2023/2/29 10:49
|
|
|
+ */
|
|
|
+ @Transactional(
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
+ )
|
|
|
+ public ResponseResultVO<Boolean> update(MoneyAccountVO moneyAccountVO) {
|
|
|
+ // 转化实体
|
|
|
+ MoneyAccount moneyAccount = moneyAccountConvert.convertToPo(moneyAccountVO);
|
|
|
+ return ResponseResultUtil.success(super.update(moneyAccount, new UpdateWrapper<MoneyAccount>().lambda().eq(MoneyAccount::getMacId,
|
|
|
+ UUID.fromString(moneyAccount.getMacId()))));
|
|
|
+ }
|
|
|
}
|