Commit 61d1fef3 authored by 姬鋆屾's avatar 姬鋆屾
parents 3b302b2d f12aaed8
...@@ -127,7 +127,6 @@ export default { ...@@ -127,7 +127,6 @@ export default {
return; return;
} }
this.tableData.loading = true; this.tableData.loading = true;
return;
this.$post("/attendance/stat/summary", this.query, { this.$post("/attendance/stat/summary", this.query, {
cancelToken: this.source.token, cancelToken: this.source.token,
}) })
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
label="负责人姓名" label="负责人姓名"
prop="staffId" prop="staffId"
filterable filterable
:disabled="editId?true:false"
v-model="form.staffId" v-model="form.staffId"
:enumData="userList" :enumData="userList"
placeholder="请输入负责人姓名" placeholder="请输入负责人姓名"
...@@ -62,7 +63,7 @@ ...@@ -62,7 +63,7 @@
</el-row> </el-row>
<div style="background-color: rgba(242, 246, 252, 1);padding: 20px;"> <div style="background-color: rgba(242, 246, 252, 1);padding: 20px;">
<wintable ref="wintable" :hallId="dict.hallId" class="wintabel" @selection-change="selectionChange"/> <wintable :editId="editId" ref="wintable" :hallId="dict.hallId" class="wintabel" @selection-change="selectionChange"/>
</div> </div>
<div style="padding: 20px;"> <div style="padding: 20px;">
...@@ -108,14 +109,39 @@ export default { ...@@ -108,14 +109,39 @@ export default {
] ]
}, },
userList:{}, userList:{},
userarr:[],//人员数组
checkArr:[],//选中窗口
editId:''//编辑id
}; };
}, },
methods: { methods: {
//重写表单
beforeSubmit(data){
data['deptName'] = this.dict.deptId[data.deptId]
data['salaName'] = this.dict.salaId[data.salaId]
data['staffName'] = this.userList[data.staffId]
try {
const userObj = this.userarr.find(v=>v.id == data.staffId) //工号
data['number'] = userObj.workNum
// 窗口列表
const checkArr = []
this.checkArr.forEach(v=>{
checkArr.push({
windowId:v.id,
windowName:v.name,
windowCode:v.fromnum,
building:v.building,
level:v.level
})
})
data['windowOwnerDetailList'] = checkArr
} catch (error) {}
return data
},
// 选中窗口 // 选中窗口
selectionChange(v){ selectionChange(v){
console.log(v,this.$refs.wintable,"########@@@@") this.checkArr = v
}, },
cascaderChange(val) { cascaderChange(val) {
if (this.deptList.length > 0) { if (this.deptList.length > 0) {
...@@ -130,7 +156,7 @@ export default { ...@@ -130,7 +156,7 @@ export default {
this.$post("/staff/list",{page:1,size:-1}).then(res=>{ this.$post("/staff/list",{page:1,size:-1}).then(res=>{
const {code,data} = res const {code,data} = res
if(code == 1){ if(code == 1){
const userList = data.data this.userarr = data.data
const arr = {} const arr = {}
data.data.forEach(element => { data.data.forEach(element => {
arr[element.id] = element.name arr[element.id] = element.name
...@@ -144,6 +170,7 @@ export default { ...@@ -144,6 +170,7 @@ export default {
}, },
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.editId = row.staffId
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl = "window/owner/edit"; this.urls.currUrl = "window/owner/edit";
...@@ -153,6 +180,7 @@ export default { ...@@ -153,6 +180,7 @@ export default {
}, },
/** 新增 */ /** 新增 */
add(row) { add(row) {
this.editId = ''
this.reset(); this.reset();
this.urls.currUrl = "window/owner/add"; this.urls.currUrl = "window/owner/add";
this.getData(); this.getData();
...@@ -161,6 +189,7 @@ export default { ...@@ -161,6 +189,7 @@ export default {
}, },
/** 查看*/ /** 查看*/
view(row) { view(row) {
this.editId = row.staffId
this.reset(); this.reset();
this.query = { id: row.id }; this.query = { id: row.id };
this.urls.currUrl = "window/owner/view"; this.urls.currUrl = "window/owner/view";
......
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
{ {
name: "name", name: "staffName",
type: "text", type: "text",
label: "姓名", label: "姓名",
fuzzy: true, fuzzy: true,
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
{ label: "部门名称", prop: "deptName" }, { label: "部门名称", prop: "deptName" },
{ label: "姓名", prop: "name" }, { label: "姓名", prop: "staffName" },
{ label: "工号", prop: "number" }, { label: "工号", prop: "number" },
...@@ -73,6 +73,7 @@ export default { ...@@ -73,6 +73,7 @@ export default {
return ( return (
<table-buttons <table-buttons
noAdd noAdd
noView
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<script> <script>
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
props:['hallId','checkId'], props:['hallId','checkId','editId'],
mixins: [table], mixins: [table],
methods:{ methods:{
handleSelectionChange(v){ handleSelectionChange(v){
...@@ -16,12 +16,42 @@ export default { ...@@ -16,12 +16,42 @@ export default {
beforeFecth(){ beforeFecth(){
this.pageInfo.list = '/window/owner/subWindowList' this.pageInfo.list = '/window/owner/subWindowList'
}, },
//重写
afterRender(info){
const {data} = info
if(this.editId){
// 编辑的时候回显
const toggleRowSelection = []
data.forEach(element => {
if(element.selected == 1){
toggleRowSelection.push(element)
}
});
setTimeout(()=>{
this.toggleRowSelection = toggleRowSelection
})
}
}
}, },
created(){ created(){
this.config.search[0].enumData = this.hallId this.config.search[0].enumData = this.hallId
// setTimeout(()=>{ console.log(this.editId,"editId")
// this.toggleRowSelection = [this.tableData.data[0]]
// },2000) },
watch: {
editId:{
handler:function(v){
if(v){
this.query = {staffId:v}
}else{
this.query = {}
}
this.getData()
},
immediate:true
}
}, },
data(){ data(){
return { return {
......
...@@ -64,13 +64,12 @@ ...@@ -64,13 +64,12 @@
<profiles.nacos.namespace>smart-gov</profiles.nacos.namespace> <profiles.nacos.namespace>smart-gov</profiles.nacos.namespace>
<profiles.log.path>/home/mortals/app/logs</profiles.log.path> <profiles.log.path>/home/mortals/app/logs</profiles.log.path>
<profiles.log.level>INFO</profiles.log.level> <profiles.log.level>INFO</profiles.log.level>
<profiles.sms.smsSendUrl>http://127.0.0.1:8089/api/index/index</profiles.sms.smsSendUrl> <profiles.sms.smsSendUrl>http://sms.wx3.com.cn/api/index/index</profiles.sms.smsSendUrl>
<profiles.sms.apiId>k6BVS1PEbyzcJAE4</profiles.sms.apiId> <profiles.sms.apiId>ADsUXLrS81vZDU95</profiles.sms.apiId>
<profiles.hik.host>8.136.255.30:8001</profiles.hik.host> <profiles.hik.host>8.136.255.30:8001</profiles.hik.host>
<profiles.hik.protocol>http://</profiles.hik.protocol> <profiles.hik.protocol>http://</profiles.hik.protocol>
<profiles.hik.appKey>25128371</profiles.hik.appKey> <profiles.hik.appKey>25128371</profiles.hik.appKey>
<profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret> <profiles.hik.appSecret>2m9RcPJOKq5j2QPQM4v5</profiles.hik.appSecret>
<profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain> <profiles.dingtalk.domain>https://oapi.dingtalk.com</profiles.dingtalk.domain>
<profiles.dingtalk.oaUrl>api.dingtalk.com</profiles.dingtalk.oaUrl> <profiles.dingtalk.oaUrl>api.dingtalk.com</profiles.dingtalk.oaUrl>
<profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId> <profiles.dingtalk.agentId>2652674890</profiles.dingtalk.agentId>
......
...@@ -7,10 +7,10 @@ import java.util.Map; ...@@ -7,10 +7,10 @@ import java.util.Map;
* 考核等级 * 考核等级
*/ */
public enum ExamineLevelEnum { public enum ExamineLevelEnum {
(1, "通过"), (1, ""),
较好(2, "不通过"), 较好(2, "较好"),
一般(3, "通过"), 一般(3, "一般"),
较差(4, "不通过"); 较差(4, "较差");
private Integer value; private Integer value;
private String desc; private String desc;
......
package com.mortals.xhx.module.check.service; package com.mortals.xhx.module.check.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity; import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.dao.CheckWindowPerformDao; import com.mortals.xhx.module.check.dao.CheckWindowPerformDao;
...@@ -13,4 +15,13 @@ import com.mortals.xhx.module.check.dao.CheckWindowPerformDao; ...@@ -13,4 +15,13 @@ import com.mortals.xhx.module.check.dao.CheckWindowPerformDao;
public interface CheckWindowPerformService extends ICRUDService<CheckWindowPerformEntity,Long>{ public interface CheckWindowPerformService extends ICRUDService<CheckWindowPerformEntity,Long>{
CheckWindowPerformDao getDao(); CheckWindowPerformDao getDao();
/**
* 核查人工审核
* @param entity
* @param context
* @throws AppException
*/
void examine(CheckWindowPerformEntity entity, Context context) throws AppException;
} }
\ No newline at end of file
package com.mortals.xhx.module.check.service; package com.mortals.xhx.module.check.service;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService; import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao; import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
/** /**
* CheckWindowWorkmanPerformService * CheckWindowWorkmanPerformService
* *
...@@ -13,4 +16,12 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao; ...@@ -13,4 +16,12 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
public interface CheckWindowWorkmanPerformService extends ICRUDService<CheckWindowWorkmanPerformEntity,Long>{ public interface CheckWindowWorkmanPerformService extends ICRUDService<CheckWindowWorkmanPerformEntity,Long>{
CheckWindowWorkmanPerformDao getDao(); CheckWindowWorkmanPerformDao getDao();
/**
* 核查人工审核
* @param entity
* @param context
* @throws AppException
*/
void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException;
} }
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.module.check.dao.CheckWindowPerformDao; import com.mortals.xhx.module.check.dao.CheckWindowPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity; import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.service.CheckWindowPerformService; import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.Date;
/** /**
* CheckWindowPerformService * CheckWindowPerformService
* 窗口考核核查 service实现 * 窗口考核核查 service实现
...@@ -17,5 +24,36 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,5 +24,36 @@ import lombok.extern.slf4j.Slf4j;
@Service("checkWindowPerformService") @Service("checkWindowPerformService")
@Slf4j @Slf4j
public class CheckWindowPerformServiceImpl extends AbstractCRUDServiceImpl<CheckWindowPerformDao, CheckWindowPerformEntity, Long> implements CheckWindowPerformService { public class CheckWindowPerformServiceImpl extends AbstractCRUDServiceImpl<CheckWindowPerformDao, CheckWindowPerformEntity, Long> implements CheckWindowPerformService {
@Override
public void examine(CheckWindowPerformEntity entity, Context context) throws AppException {
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckWindowPerformEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if(StringUtils.isNotEmpty(entity.getLeaderCheckResult())){
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setLeaderCheckPerson(user.getRealName());
}
entity.setLeaderCheckTime(new Date());
}
if(StringUtils.isNotEmpty(entity.getManageCheckResult())){
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setManageCheckPerson(user.getRealName());
}
entity.setManageCheckTime(new Date());
}
entity.setUpdateTime(new Date());
if(StringUtils.isNotEmpty(entity.getLeaderCheckResult())&&StringUtils.isNotEmpty(entity.getManageCheckResult())) {
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
}
dao.update(entity);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.check.service.impl; package com.mortals.xhx.module.check.service.impl;
import com.mortals.framework.service.IUser;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -7,6 +10,9 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao; ...@@ -7,6 +10,9 @@ import com.mortals.xhx.module.check.dao.CheckWindowWorkmanPerformDao;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity; import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService; import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Date;
/** /**
* CheckWindowWorkmanPerformService * CheckWindowWorkmanPerformService
* 窗口人员考核汇总核查 service实现 * 窗口人员考核汇总核查 service实现
...@@ -17,5 +23,25 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,5 +23,25 @@ import lombok.extern.slf4j.Slf4j;
@Service("checkWindowWorkmanPerformService") @Service("checkWindowWorkmanPerformService")
@Slf4j @Slf4j
public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<CheckWindowWorkmanPerformDao, CheckWindowWorkmanPerformEntity, Long> implements CheckWindowWorkmanPerformService { public class CheckWindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<CheckWindowWorkmanPerformDao, CheckWindowWorkmanPerformEntity, Long> implements CheckWindowWorkmanPerformService {
@Override
public void examine(CheckWindowWorkmanPerformEntity entity, Context context) throws AppException {
if (entity.getId() == null) {
throw new AppException("核查记录ID不能为空");
}
CheckWindowWorkmanPerformEntity temp = this.get(entity.getId());
if (temp == null) {
throw new AppException("核查记录ID不正确");
}
if (context != null && context.getUser() != null) {
IUser user = context.getUser();
entity.setUpdateUserId(user.getId());
entity.setManageCheckPerson(user.getRealName());
}
entity.setManageCheckTime(new Date());
entity.setUpdateTime(new Date());
entity.setCheckStatus(CheckStatusEnum.已处理.getValue()); //处理状态(1.未处理,2.已处理)
dao.update(entity);
}
} }
\ No newline at end of file
...@@ -49,5 +49,37 @@ public class CheckWindowPerformController extends BaseCRUDJsonBodyMappingControl ...@@ -49,5 +49,37 @@ public class CheckWindowPerformController extends BaseCRUDJsonBodyMappingControl
super.init(model, context); super.init(model, context);
} }
/**
* 审核
*
* @param entity
* @return
*/
@PostMapping({"examine"})
public String examine(@RequestBody CheckWindowPerformEntity entity){
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "窗口考核核查";
try {
this.service.examine(entity, context);
model.put("id", entity.getId());
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
} }
\ No newline at end of file
package com.mortals.xhx.module.check.web; package com.mortals.xhx.module.check.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService; import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -48,5 +49,36 @@ public class CheckWindowWorkmanPerformController extends BaseCRUDJsonBodyMapping ...@@ -48,5 +49,36 @@ public class CheckWindowWorkmanPerformController extends BaseCRUDJsonBodyMapping
super.init(model, context); super.init(model, context);
} }
/**
* 审核
*
* @param entity
* @return
*/
@PostMapping({"examine"})
public String examine(@RequestBody CheckWindowWorkmanPerformEntity entity){
Map<String, Object> model = new HashMap();
Context context = this.getContext();
int code = 1;
String busiDesc = "窗口人员考核汇总核查";
try {
this.service.examine(entity, context);
model.put("id", entity.getId());
model.put("entity", entity);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】 [id:" + entity.getId() + "]");
} catch (Exception var9) {
this.doException(this.request, busiDesc, model, var9);
model.put("entity", entity);
this.init(model, context);
code = this.saveException(entity, model, context, var9);
}
this.init(model, context);
JSONObject ret = new JSONObject();
ret.put("code", code);
ret.put("msg", model.remove("message_info"));
ret.put("data", model);
return ret.toJSONString();
}
} }
\ No newline at end of file
...@@ -65,8 +65,9 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -65,8 +65,9 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
@Override @Override
public List<WindowPdu> subWindowPduList(WindowPdu pdu) { public List<WindowPdu> subWindowPduList(WindowPdu pdu) {
List<WindowPdu> subList = new ArrayList<>();
List<WindowPdu> ownerList = new ArrayList<>(); List<WindowPdu> ownerList = new ArrayList<>();
List<WindowPdu> subList = new ArrayList<>();
List<WindowPdu> subTwoList = new ArrayList<>();
List<WindowOwnerDetailEntity> ownerDetail = windowOwnerDetailService.getAllList(); List<WindowOwnerDetailEntity> ownerDetail = windowOwnerDetailService.getAllList();
if (!CollectionUtils.isEmpty(ownerDetail)) { if (!CollectionUtils.isEmpty(ownerDetail)) {
Long[] windows = ownerDetail.stream().map(WindowOwnerDetailEntity::getWindowId).toArray(Long[]::new); Long[] windows = ownerDetail.stream().map(WindowOwnerDetailEntity::getWindowId).toArray(Long[]::new);
...@@ -85,19 +86,28 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -85,19 +86,28 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
//查询当前负责人负责的窗口 //查询当前负责人负责的窗口
WindowOwnerDetailQuery detailQuery = new WindowOwnerDetailQuery(); WindowOwnerDetailQuery detailQuery = new WindowOwnerDetailQuery();
detailQuery.setOwnerId(pdu.getStaffId()); detailQuery.setOwnerId(pdu.getStaffId());
Long[] windowIds = windowOwnerDetailService.find(detailQuery).stream().map(WindowOwnerDetailEntity::getId).toArray(Long[]::new); Long[] windowIds = windowOwnerDetailService.find(detailQuery).stream().map(WindowOwnerDetailEntity::getWindowId).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(windowIds)) { if (!ObjectUtils.isEmpty(windowIds)) {
WindowPdu ownerWindowPdu = new WindowPdu(); WindowPdu ownerWindowPdu = new WindowPdu();
ownerWindowPdu.setIdList(Arrays.asList(windowIds)); ownerWindowPdu.setIdList(Arrays.asList(windowIds));
Rest<RespData<List<WindowPdu>>> ownerRest = windowFeign.list(ownerWindowPdu); Rest<RespData<List<WindowPdu>>> ownerRest = windowFeign.list(ownerWindowPdu);
if (ownerRest.getCode() == YesNoEnum.YES.getValue()) { if (ownerRest.getCode() == YesNoEnum.YES.getValue()) {
ownerList = ownerRest.getData().getData(); ownerRest.getData().getData().stream().forEach(item -> {
item.setSelected(YesNoEnum.YES.getValue());
});
subTwoList = ownerRest.getData().getData();
} }
} }
} }
} }
ownerList.addAll(subList); ownerList.addAll(subList);
ownerList.addAll(subTwoList);
ownerList = ownerList.parallelStream().sorted(Comparator.comparing(WindowPdu::getSelected).reversed()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(pdu.getHallId())) {
ownerList = ownerList.stream().filter(f -> pdu.getHallId().equals(f.getHallId())).collect(Collectors.toList());
}
return ownerList; return ownerList;
} }
...@@ -156,6 +166,11 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -156,6 +166,11 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) { if (!ObjectUtils.isEmpty(entity.getWindowOwnerDetailList())) {
entity.setWindowCount(entity.getWindowOwnerDetailList().size()); entity.setWindowCount(entity.getWindowOwnerDetailList().size());
} }
WindowOwnerEntity windowOwnerEntity = this.selectOne(new WindowOwnerQuery().staffId(entity.getStaffId()));
if(ObjectUtils.isEmpty(windowOwnerEntity)){
throw new AppException("已经存在该负责人窗口记录!");
}
} }
@Override @Override
...@@ -199,10 +214,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -199,10 +214,7 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
@Override @Override
public Rest<List<String>> getPerformMonthList(Context context) { public Rest<List<String>> getPerformMonthList(Context context) {
Set<String> collectSet = new HashSet<>(); Set<String> collectSet = new HashSet<>();
//查询所有窗口汇总表 //查询所有窗口汇总表
WindowPerformQuery windowPerformQuery = new WindowPerformQuery(); WindowPerformQuery windowPerformQuery = new WindowPerformQuery();
windowPerformQuery.setOwnerId(context.getUser().getCustomerId()); windowPerformQuery.setOwnerId(context.getUser().getCustomerId());
...@@ -230,4 +242,20 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD ...@@ -230,4 +242,20 @@ public class WindowOwnerServiceImpl extends AbstractCRUDServiceImpl<WindowOwnerD
} }
@Override
protected void removeBefore(Long[] ids, Context context) throws AppException {
super.removeBefore(ids, context);
//删除窗口人员
List<WindowOwnerEntity> windowOwnerEntities = this.get(ids, context);
List<Long> collect = windowOwnerEntities.stream().map(item -> item.getWindowId()).collect(Collectors.toList());
if (!ObjectUtils.isEmpty(collect)) {
WindowOwnerDetailQuery detailQuery = new WindowOwnerDetailQuery();
detailQuery.ownerIdList(collect);
Long[] delIds = windowOwnerDetailService.find(detailQuery).stream().map(item -> item.getId()).toArray(Long[]::new);
if (!ObjectUtils.isEmpty(delIds)) {
windowOwnerDetailService.remove(delIds, context);
}
}
}
} }
\ No newline at end of file
...@@ -9,6 +9,8 @@ import com.mortals.xhx.module.check.model.CheckWindowPerformQuery; ...@@ -9,6 +9,8 @@ import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity; import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery; import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService; import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.*; import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo; import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
...@@ -24,10 +26,7 @@ import com.mortals.xhx.module.window.service.WindowPerformService; ...@@ -24,10 +26,7 @@ import com.mortals.xhx.module.window.service.WindowPerformService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -45,11 +44,20 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf ...@@ -45,11 +44,20 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
private CheckWindowPerformService checkWindowPerformService; private CheckWindowPerformService checkWindowPerformService;
@Autowired @Autowired
private WindowWorkmanPerformService windowWorkmanPerformService; private WindowWorkmanPerformService windowWorkmanPerformService;
@Autowired
private StaffService staffService;
@Override @Override
protected void saveBefore(WindowPerformEntity entity, Context context) throws AppException { protected void saveBefore(WindowPerformEntity entity, Context context) throws AppException {
super.saveBefore(entity, context); super.saveBefore(entity, context);
StaffEntity staff = staffService.get(entity.getOwnerId());
if(staff!=null){
entity.setDeptId(staff.getDeptId());
entity.setDeptName(staff.getDeptName());
entity.setSalaId(staff.getSalaId());
entity.setSalaName(staff.getSalaName());
}
deleteExistBill(entity, context); deleteExistBill(entity, context);
} }
...@@ -114,7 +122,7 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf ...@@ -114,7 +122,7 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
@Override @Override
public Rest<List<WindowPerformAllVo>> getAllList(WindowPerformQuery query, Context context) { public Rest<List<WindowPerformAllVo>> getAllList(WindowPerformQuery query, Context context) {
ArrayList<WindowPerformAllVo> allList = new ArrayList<>(); List<WindowPerformAllVo> allList = new ArrayList<>();
query.setOwnerId(context.getUser().getCustomerId()); query.setOwnerId(context.getUser().getCustomerId());
List<WindowPerformEntity> windowPerformEntities = this.find(query, context); List<WindowPerformEntity> windowPerformEntities = this.find(query, context);
if (!ObjectUtils.isEmpty(windowPerformEntities)) { if (!ObjectUtils.isEmpty(windowPerformEntities)) {
...@@ -146,6 +154,10 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf ...@@ -146,6 +154,10 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
}).collect(Collectors.toList()); }).collect(Collectors.toList());
allList.addAll(collect); allList.addAll(collect);
} }
allList = allList.stream().sorted(Comparator.comparing(WindowPerformAllVo::getFillDate)).collect(Collectors.toList());
return Rest.ok(allList); return Rest.ok(allList);
} }
} }
\ No newline at end of file
...@@ -12,6 +12,8 @@ import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity; ...@@ -12,6 +12,8 @@ import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery; import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService; import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService; import com.mortals.xhx.module.check.service.CheckWindowWorkmanPerformService;
import com.mortals.xhx.module.staff.model.StaffEntity;
import com.mortals.xhx.module.staff.service.StaffService;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity; import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailEntity;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery; import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformDetailService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformDetailService;
...@@ -47,6 +49,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -47,6 +49,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
private WindowWorkmanPerformDetailService windowWorkmanPerformDetailService; private WindowWorkmanPerformDetailService windowWorkmanPerformDetailService;
@Autowired @Autowired
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService; private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Autowired
private StaffService staffService;
@Autowired @Autowired
...@@ -56,7 +60,13 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -56,7 +60,13 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
@Override @Override
protected void saveBefore(WindowWorkmanPerformEntity entity, Context context) throws AppException { protected void saveBefore(WindowWorkmanPerformEntity entity, Context context) throws AppException {
buildWindowInfo(entity); buildWindowInfo(entity);
StaffEntity staff = staffService.get(entity.getOwnerId());
if(staff!=null){
entity.setDeptId(staff.getDeptId());
entity.setDeptName(staff.getDeptName());
entity.setSalaId(staff.getSalaId());
entity.setSalaName(staff.getSalaName());
}
super.saveBefore(entity, context); super.saveBefore(entity, context);
} }
......
...@@ -2,8 +2,10 @@ package com.mortals.xhx.module.window.web; ...@@ -2,8 +2,10 @@ package com.mortals.xhx.module.window.web;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController; import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.CheckStatusEnum;
import com.mortals.xhx.common.code.ExamineLevelEnum; import com.mortals.xhx.common.code.ExamineLevelEnum;
import com.mortals.xhx.common.code.FillStatusEnum; import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.code.WindowCheckResultEnum;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformEntity; import com.mortals.xhx.module.window.model.WindowWorkmanPerformEntity;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService; import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
...@@ -30,6 +32,8 @@ public class WindowWorkmanPerformController extends BaseCRUDJsonBodyMappingContr ...@@ -30,6 +32,8 @@ public class WindowWorkmanPerformController extends BaseCRUDJsonBodyMappingContr
protected void init(Map<String, Object> model, Context context) { protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "examineLevel", ExamineLevelEnum.getEnumMap()); this.addDict(model, "examineLevel", ExamineLevelEnum.getEnumMap());
this.addDict(model, "fillStatus", FillStatusEnum.getEnumMap()); this.addDict(model, "fillStatus", FillStatusEnum.getEnumMap());
this.addDict(model, "manageCheckResult", WindowCheckResultEnum.getEnumMap());
this.addDict(model, "checkStatus", CheckStatusEnum.getEnumMap());
super.init(model, context); super.init(model, context);
} }
......
...@@ -94,9 +94,15 @@ public class WindowPdu extends BaseEntityLong { ...@@ -94,9 +94,15 @@ public class WindowPdu extends BaseEntityLong {
*/ */
private String hallName; private String hallName;
/** 序号,主键,自增长排除列表 */ /**
* 序号,主键,自增长排除列表
*/
private List<Long> idNotList; private List<Long> idNotList;
private List<Long> idList; private List<Long> idList;
/**
* 0未选中 1选中 默认为0
*/
private Integer selected = 0;
} }
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