|
@@ -20,8 +20,10 @@ import com.unis.module.coding.dal.mysql.cwxxyear.CwxxYearMapper;
|
20
|
20
|
import com.unis.module.coding.dal.mysql.kqxx.KqxxMapper;
|
21
|
21
|
import org.springframework.stereotype.Service;
|
22
|
22
|
import org.springframework.validation.annotation.Validated;
|
|
23
|
+
|
23
|
24
|
import javax.annotation.Resource;
|
24
|
25
|
import java.util.List;
|
|
26
|
+
|
25
|
27
|
import static com.unis.framework.common.exception.util.ServiceExceptionUtil.exception;
|
26
|
28
|
import static com.unis.module.core.enums.ErrorCodeConstants.CWXX_NOT_EXISTS;
|
27
|
29
|
import static com.unis.module.infra.enums.ErrorCodeConstants.ERROR;
|
|
@@ -46,17 +48,10 @@ public class CwxxServiceImpl implements CwxxService {
|
46
|
48
|
public Long createCwxx(CwxxSaveReqVO createReqVO) {
|
47
|
49
|
//财务信息根据单位绑定,有就修改,没有就添加
|
48
|
50
|
CwxxDO cwxx = BeanUtils.toBean(createReqVO, CwxxDO.class);
|
49
|
|
- List<CwxxDO> dept_id = cwxxMapper.selectList(new QueryWrapper<CwxxDO>().eq("DEPT_ID", createReqVO.getDeptId()));
|
50
|
|
- if (CollectionUtils.isEmpty(dept_id)) {
|
51
|
|
- // 插入
|
52
|
|
- cwxx.setId(YitIdHelper.nextId());
|
53
|
|
- cwxxMapper.insert(cwxx);
|
54
|
|
- } else {
|
55
|
|
- //更改
|
56
|
|
- cwxx.setId(dept_id.get(0).getId());
|
57
|
|
- cwxxMapper.updateById(cwxx);
|
58
|
|
- }
|
59
|
|
-
|
|
51
|
+// List<CwxxDO> dept_id = cwxxMapper.selectList(new QueryWrapper<CwxxDO>().eq("DEPT_ID", createReqVO.getDeptId()));
|
|
52
|
+ // 插入
|
|
53
|
+ cwxx.setId(YitIdHelper.nextId());
|
|
54
|
+ cwxxMapper.insert(cwxx);
|
60
|
55
|
// 返回
|
61
|
56
|
return cwxx.getId();
|
62
|
57
|
}
|