Commit 93ff57ed by Your Name Committed by chenzg

更新部门下不能新增岗位员工

parent 44134048
...@@ -1000,7 +1000,7 @@ public class SpmkController { ...@@ -1000,7 +1000,7 @@ public class SpmkController {
*/ */
@PostMapping(value = "/approved_addDetail") @PostMapping(value = "/approved_addDetail")
@ApiOperation(value = "A审核详情数据转换", httpMethod = "POST", notes = "") @ApiOperation(value = "A审核详情数据转换", httpMethod = "POST", notes = "")
public void addApproveDetail(){ public void addApproveDetail(String status){
spmkService.addApproveDetail(); spmkService.addApproveDetail(status);
} }
} }
...@@ -5,7 +5,6 @@ import java.util.List; ...@@ -5,7 +5,6 @@ import java.util.List;
import cn.timer.api.bean.spmk.SpmkApprovalG; import cn.timer.api.bean.spmk.SpmkApprovalG;
import cn.timer.api.config.annotation.UserBean; import cn.timer.api.config.annotation.UserBean;
import cn.timer.api.dto.spmk.SpmkApproveDetailDto; import cn.timer.api.dto.spmk.SpmkApproveDetailDto;
import com.fasterxml.jackson.core.JsonProcessingException;
public interface SpmkService { public interface SpmkService {
...@@ -15,7 +14,7 @@ public interface SpmkService { ...@@ -15,7 +14,7 @@ public interface SpmkService {
List<SpmkApprovalG> selectListAg(UserBean userBean); List<SpmkApprovalG> selectListAg(UserBean userBean);
void addApproveDetail(); void addApproveDetail(String status);
} }
...@@ -11,7 +11,6 @@ import cn.timer.api.dao.spmk.*; ...@@ -11,7 +11,6 @@ import cn.timer.api.dao.spmk.*;
import cn.timer.api.dto.spmk.FlowChildren; import cn.timer.api.dto.spmk.FlowChildren;
import cn.timer.api.dto.spmk.Router; import cn.timer.api.dto.spmk.Router;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import javafx.scene.text.Text;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -153,56 +152,53 @@ public class SpmkServiceImpl implements SpmkService{ ...@@ -153,56 +152,53 @@ public class SpmkServiceImpl implements SpmkService{
/** /**
* 审核汇总详情数据转换 * 审核汇总详情数据转换
* @param status
*/ */
@Override @Override
public void addApproveDetail() { public void addApproveDetail(String status) {
if ("1".equals(status)) {
QueryWrapper queryWrapper = new QueryWrapper<SpmkApproveDetail>().select("id,approve_summary_id","name","department_name","request_data","froms","router","flow_children"); QueryWrapper queryWrapper = new QueryWrapper<SpmkApproveDetail>().select("id,approve_summary_id", "name", "department_name", "request_data", "froms", "router", "flow_children");
List<SpmkApproveDetail> spmkApproveDetails = spmkApproveDetailMapper.selectList(queryWrapper); List<SpmkApproveDetail> spmkApproveDetails = spmkApproveDetailMapper.selectList(queryWrapper);
spmkApproveDetails.forEach(t -> {
spmkApproveDetails.forEach (t -> { SpmkApproveDetailSummary spmkApproveDetailSummary = new SpmkApproveDetailSummary();
SpmkApproveDetailSummary spmkApproveDetailSummary = new SpmkApproveDetailSummary(); spmkApproveDetailSummary.setApproveSummaryId(t.getApproveSummaryId());
spmkApproveDetailSummary.setApproveSummaryId(t.getApproveSummaryId()); spmkApproveDetailSummary.setDepartmentName(t.getDepartmentName());
spmkApproveDetailSummary.setDepartmentName(t.getDepartmentName()); spmkApproveDetailSummary.setName(t.getName());
spmkApproveDetailSummary.setName(t.getName());
SpmkApproveDetailSummary sca = SpmkApproveDetailSummary.builder().build();
try {
Object deserialize2 = ObjectUtil.deserialize(t.getFlowChildren());
String flowChidren = JSON.toJSONString(deserialize2);
spmkApproveDetailSummary.setFlowChildren(flowChidren);
}catch (Exception e){
e.printStackTrace();
}finally {
try { try {
Object deserialize1 = ObjectUtil.deserialize(t.getFroms()); Object deserialize2 = ObjectUtil.deserialize(t.getFlowChildren());
String froms = JSON.toJSONString(deserialize1); String flowChidren = JSON.toJSONString(deserialize2);
spmkApproveDetailSummary.setFroms(froms); spmkApproveDetailSummary.setFlowChildren(flowChidren);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
}finally { } finally {
try { try {
Object deserialize = ObjectUtil.deserialize(t.getRequestData()); Object deserialize1 = ObjectUtil.deserialize(t.getFroms());
String s = JSON.toJSONString(deserialize); String froms = JSON.toJSONString(deserialize1);
spmkApproveDetailSummary.setRequestData(s); spmkApproveDetailSummary.setFroms(froms);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
}finally { } finally {
try { try {
Router router = ObjectUtil.deserialize(t.getRouter()); Object deserialize = ObjectUtil.deserialize(t.getRequestData());
String s = JSON.toJSONString(router); String s = JSON.toJSONString(deserialize);
spmkApproveDetailSummary.setRouter(s); spmkApproveDetailSummary.setRequestData(s);
}catch (Exception e){ } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} } finally {
finally { try {
Router router = ObjectUtil.deserialize(t.getRouter());
BeanUtil.copyProperties(spmkApproveDetailSummary, sca, "id"); String s = JSON.toJSONString(router);
sca.insert(); spmkApproveDetailSummary.setRouter(s);
} catch (Exception e) {
e.printStackTrace();
} finally {
spmkApproveDetailSummary.insert();
}
} }
} }
} }
} });
}); }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment