|
@@ -3,6 +3,12 @@ package org.jeecg.ctop.finance.settlement.service.serviceImpl;
|
|
|
import cn.afterturn.easypoi.excel.ExcelImportUtil;
|
|
|
import cn.afterturn.easypoi.excel.entity.ImportParams;
|
|
|
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
|
|
|
+import cn.com.ctop.alarm.modules.entity.RuleAccountTemplate;
|
|
|
+import cn.com.ctop.alarm.modules.service.impl.RuleAccountTemplateServiceImpl;
|
|
|
+import cn.com.ctop.common.module.entity.UserAllocation;
|
|
|
+import cn.com.ctop.common.module.service.impl.UserAllocationServiceImpl;
|
|
|
+import cn.com.ctop.common.module.utils.Check;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
@@ -13,11 +19,20 @@ import org.jeecg.ctop.finance.settlement.entity.pojo.CtopCwjsSettlementInfo;
|
|
|
import org.jeecg.ctop.finance.settlement.entity.vo.AccountImportVo;
|
|
|
import org.jeecg.ctop.finance.settlement.mapper.SettlementInfoMapper;
|
|
|
import org.jeecg.ctop.finance.settlement.service.ISettlementInfoService;
|
|
|
+import org.jeecg.modules.ctop.entity.ProjectMember;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.http.HttpEntity;
|
|
|
+import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.client.RestTemplate;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Set;
|
|
@@ -49,6 +64,9 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
|
|
|
return Result.successMsg("财务结算-账户列表查询成功。", pageInfo);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private UserAllocationServiceImpl userAllocationService;
|
|
|
/**
|
|
|
* @description: 财务结算-修改账户状态
|
|
|
* @param id
|
|
@@ -58,10 +76,64 @@ public class SettlementInfoServiceImpl extends ServiceImpl<SettlementInfoMapper,
|
|
|
*/
|
|
|
@Override
|
|
|
public Result updSettlementStatusById(Long id, Integer status) {
|
|
|
+ // 修改状态
|
|
|
settlementInfoMapper.updSettlementStatusById(id,status);
|
|
|
+
|
|
|
+ //同步 状态
|
|
|
+ CtopCwjsSettlementInfo settlementInfo = settlementInfoMapper.selectById(id);
|
|
|
+ UserAllocation userAllocation = userAllocationService.getByAccountId(new Long(settlementInfo.getAccountId()));
|
|
|
+ userAllocation.setAccountStatus(status);
|
|
|
+ userAllocationService.editUserAlloCation(userAllocation);
|
|
|
+
|
|
|
return Result.successMsg("财务结算-修改账户状态成功。", null);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+/*
|
|
|
+ public Result<UserAllocation> edit(UserAllocation userAllocation) {
|
|
|
+ Result<UserAllocation> result = new Result<>();
|
|
|
+ UserAllocation userAllocationEntity = userAllocationService.getById(userAllocation.getId());
|
|
|
+ if (userAllocationEntity == null) {
|
|
|
+ result.error500("未找到对应实体");
|
|
|
+ } else {
|
|
|
+ boolean ok = userAllocationService.updateById(userAllocation);
|
|
|
+ Integer accountStatus = userAllocation.getAccountStatus();
|
|
|
+ if (!Check.isNull(accountStatus)) {
|
|
|
+ if (accountStatus == 1) {
|
|
|
+ QueryWrapper<RuleAccountTemplate> ruleAccountTemplateQueryWrapper = new QueryWrapper<>();
|
|
|
+ ruleAccountTemplateQueryWrapper.eq("account_id", userAllocationEntity.getAccountId());
|
|
|
+ RuleAccountTemplate updateRuleAccountTemplate = new RuleAccountTemplate();
|
|
|
+ updateRuleAccountTemplate.setTemplateStatus(1);
|
|
|
+ ruleAccountTemplateService.update(updateRuleAccountTemplate, ruleAccountTemplateQueryWrapper);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ UserAllocation update = userAllocationService.getById(userAllocation.getId());
|
|
|
+ QueryWrapper<ProjectMember> memberQueryWrapper = new QueryWrapper<>();
|
|
|
+ memberQueryWrapper.eq("user_id", update.getUserId());
|
|
|
+ memberQueryWrapper.eq("project_id", update.getProjectId());
|
|
|
+ memberQueryWrapper.last("limit 1");
|
|
|
+ ProjectMember member = memberMapper.selectOne(memberQueryWrapper);
|
|
|
+ if (Check.isNull(member)) {
|
|
|
+ ProjectMember addMember = new ProjectMember();
|
|
|
+ addMember.setProjectId(userAllocationEntity.getProjectId());
|
|
|
+ addMember.setUserId(userAllocationEntity.getUserId());
|
|
|
+ addMember.setUserName(userAllocationEntity.getUserName());
|
|
|
+ String roleCode = sysRoleService.getRoleCodeByUserId(userAllocationEntity.getUserId());
|
|
|
+ if (!Check.isNull(roleCode)) {
|
|
|
+ addMember.setRoleCode(roleCode);
|
|
|
+ }
|
|
|
+ projectMemberService.save(addMember);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ok) {
|
|
|
+ result.success("修改成功!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
/**
|
|
|
*
|
|
|
* @description: 删除
|