Commit aeed079c authored by 赵啸非's avatar 赵啸非

添加窗口编码

parent a40e7a05
package com.mortals.xhx.common.code;
import java.util.LinkedHashMap;
import java.util.Map;
public enum WorkmanPerformTypeEnum {
市政务服务大厅窗口考核登记表(1, "市政务服务大厅窗口考核登记表"),
市政务服务大厅窗口工作人员考核汇总表(2, "市政务服务大厅窗口工作人员考核汇总表");
private Integer value;
private String desc;
WorkmanPerformTypeEnum(Integer value, String desc) {
this.value = value;
this.desc = desc;
}
public Integer getValue() {
return this.value;
}
public String getDesc() {
return this.desc;
}
public static WorkmanPerformTypeEnum getByValue(Integer value) {
for (WorkmanPerformTypeEnum processStatusEnum : WorkmanPerformTypeEnum.values()) {
if (processStatusEnum.getValue() == value) {
return processStatusEnum;
}
}
return null;
}
/**
* 获取Map集合
*
* @param eItem 不包含项
* @return
*/
public static Map<String, String> getEnumMap(Integer... eItem) {
Map<String, String> resultMap = new LinkedHashMap<>();
for (WorkmanPerformTypeEnum item : WorkmanPerformTypeEnum.values()) {
try {
boolean hasE = false;
for (Integer e : eItem) {
if (item.getValue() == e) {
hasE = true;
break;
}
}
if (!hasE) {
resultMap.put(item.getValue() + "", item.getDesc());
}
} catch (Exception ex) {
}
}
return resultMap;
}
}
\ No newline at end of file
package com.mortals.xhx.module.window.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* 大厅窗口信息视图对象
*
* @author zxfei
* @date 2024-01-17
*/
@Data
public class WindowPerformAllVo extends BaseEntityLong {
private String formName;
private Integer formType;
/**
* 考核年度
*/
private Integer year;
/**
* 考核月份
*/
private Integer month;
/**
* 窗口ID
*/
private Long windowId;
/**
* 窗口名称
*/
private String windowName;
/**
* 填报时间
*/
private Date fillDate;
/**
* 填报状态0暂存1提交
*/
private Integer fillStatus;
/**
* 窗口编号
*/
private String windowCode;
}
\ No newline at end of file
package com.mortals.xhx.module.window.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.window.model.WindowPerformEntity;
import com.mortals.xhx.module.window.dao.WindowPerformDao;
import com.mortals.xhx.module.window.model.WindowPerformQuery;
import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo;
import java.util.List;
/**
* WindowPerformService
*
......@@ -13,4 +20,7 @@ import com.mortals.xhx.module.window.dao.WindowPerformDao;
public interface WindowPerformService extends ICRUDService<WindowPerformEntity,Long>{
WindowPerformDao getDao();
Rest<List<WindowPerformAllVo>> getAllList(WindowPerformQuery query, Context context);
}
\ No newline at end of file
package com.mortals.xhx.module.window.service.impl;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.code.WorkmanPerformTypeEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
......@@ -7,6 +10,8 @@ import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowWorkmanPerformQuery;
import com.mortals.xhx.module.check.service.CheckWindowPerformService;
import com.mortals.xhx.module.window.model.*;
import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo;
import com.mortals.xhx.module.window.service.WindowWorkmanPerformService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -19,23 +24,27 @@ import com.mortals.xhx.module.window.service.WindowPerformService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
/**
* WindowPerformService
* 大厅窗口信息 service实现
*
* @author zxfei
* @date 2024-01-17
*/
* WindowPerformService
* 大厅窗口信息 service实现
*
* @author zxfei
* @date 2024-01-17
*/
@Service("windowPerformService")
@Slf4j
public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerformDao, WindowPerformEntity, Long> implements WindowPerformService {
@Autowired
private CheckWindowPerformService checkWindowPerformService;
@Autowired
private WindowWorkmanPerformService windowWorkmanPerformService;
@Override
......@@ -50,7 +59,7 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
.month(entity.getMonth())
.windowId(entity.getWindowId())
.fillStatus(FillStatusEnum.提交.getValue()));
if(!ObjectUtils.isEmpty(windowPerformEntity)&& entity.getFillStatus()== FillStatusEnum.提交.getValue()){
if (!ObjectUtils.isEmpty(windowPerformEntity) && entity.getFillStatus() == FillStatusEnum.提交.getValue()) {
this.remove(Arrays.asList(windowPerformEntity.getId()), context);
//删除
......@@ -69,7 +78,7 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
protected void saveAfter(WindowPerformEntity entity, Context context) throws AppException {
//对同一个窗口的同一时间只能有一个窗口进行操作
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
if (entity.getFillStatus() == FillStatusEnum.提交.getValue()) {
saveToCheck(entity);
}
super.saveAfter(entity, context);
......@@ -77,7 +86,7 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
@Override
protected void updateAfter(WindowPerformEntity entity, Context context) throws AppException {
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
if (entity.getFillStatus() == FillStatusEnum.提交.getValue()) {
saveToCheck(entity);
}
super.updateAfter(entity, context);
......@@ -86,11 +95,11 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
@Override
protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<CheckWindowPerformEntity> performEntitys = checkWindowPerformService.find(new CheckWindowPerformQuery().recordIdList(Arrays.asList(ids)));
checkWindowPerformService.removeList(performEntitys,context);
checkWindowPerformService.removeList(performEntitys, context);
super.removeAfter(ids, context, result);
}
private void saveToCheck(WindowPerformEntity entity){
private void saveToCheck(WindowPerformEntity entity) {
CheckWindowPerformEntity perform = new CheckWindowPerformEntity();
perform.initAttrValue();
BeanUtils.copyProperties(entity, perform, BeanUtil.getNullPropertyNames(entity));
......@@ -102,4 +111,39 @@ public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerf
perform.setUpdateUserId(null);
checkWindowPerformService.save(perform);
}
@Override
public Rest<List<WindowPerformAllVo>> getAllList(WindowPerformQuery query, Context context) {
ArrayList<WindowPerformAllVo> allList = new ArrayList<>();
query.setOwnerId(context.getUser().getCustomerId());
List<WindowPerformEntity> windowPerformEntities = this.find(query, context);
if (!ObjectUtils.isEmpty(windowPerformEntities)) {
List<WindowPerformAllVo> collect = windowPerformEntities.stream().map(item -> {
WindowPerformAllVo windowPerformAllVo = new WindowPerformAllVo();
BeanUtils.copyProperties(item, windowPerformAllVo, BeanUtil.getNullPropertyNames(item));
windowPerformAllVo.setFormName(WorkmanPerformTypeEnum.市政务服务大厅窗口考核登记表.getDesc());
windowPerformAllVo.setFormType(WorkmanPerformTypeEnum.市政务服务大厅窗口考核登记表.getValue());
return windowPerformAllVo;
}).collect(Collectors.toList());
allList.addAll(collect);
}
WindowWorkmanPerformQuery windowWorkmanPerformQuery = new WindowWorkmanPerformQuery();
windowWorkmanPerformQuery.setOwnerId(context.getUser().getCustomerId());
windowWorkmanPerformQuery.setYear(query.getYear());
windowWorkmanPerformQuery.setMonth(query.getYear());
List<WindowWorkmanPerformEntity> windowWorkmanPerformEntities = windowWorkmanPerformService.find(windowWorkmanPerformQuery);
if (!ObjectUtils.isEmpty(windowWorkmanPerformEntities)) {
List<WindowPerformAllVo> collect = windowWorkmanPerformEntities.stream().map(item -> {
WindowPerformAllVo windowPerformAllVo = new WindowPerformAllVo();
BeanUtils.copyProperties(item, windowPerformAllVo, BeanUtil.getNullPropertyNames(item));
windowPerformAllVo.setFormName(WorkmanPerformTypeEnum.市政务服务大厅窗口工作人员考核汇总表.getDesc());
windowPerformAllVo.setFormType(WorkmanPerformTypeEnum.市政务服务大厅窗口工作人员考核汇总表.getValue());
return windowPerformAllVo;
}).collect(Collectors.toList());
allList.addAll(collect);
}
return Rest.ok(allList);
}
}
\ No newline at end of file
package com.mortals.xhx.module.window.web;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.code.SelfLevelEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.window.model.WindowPerformEntity;
import com.mortals.xhx.module.window.model.WindowPerformQuery;
import com.mortals.xhx.module.window.model.vo.WindowPerformAllVo;
import com.mortals.xhx.module.window.service.WindowPerformService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
*
......@@ -34,4 +42,28 @@ public class WindowPerformController extends BaseCRUDJsonBodyMappingController<W
}
/**
* 查询所有汇总表
*/
@PostMapping(value = "allList")
public String getAllList(@RequestBody WindowPerformQuery query) {
JSONObject jsonObject = new JSONObject();
String busiDesc = "查询所有汇总表" + this.getModuleDesc();
try {
Rest<List<WindowPerformAllVo>> allRest = this.service.getAllList(query, getContext());
// Rest<List<String>> performMonthRest = this.service.getPerformMonthList(getContext());
if(YesNoEnum.YES.getValue()== allRest.getCode()){
jsonObject.put(KEY_RESULT_DATA, allRest.getData());
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
jsonObject.put(KEY_RESULT_MSG, "查询所有汇总表!");
}
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("获取异常", e);
jsonObject.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
jsonObject.put(KEY_RESULT_MSG, super.convertException(e));
}
return jsonObject.toJSONString();
}
}
\ No newline at end of file
......@@ -928,6 +928,9 @@ ALTER TABLE `mortals_xhx_attendance_stat`
-- ----------
-- 2024-01-17 大厅窗口考核
-- ----------
-- ----------------------------
-- 窗口考核登记表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_window_perform`;
CREATE TABLE mortals_xhx_window_perform(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
......@@ -961,12 +964,17 @@ CREATE TABLE mortals_xhx_window_perform(
`createTime` datetime COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
`windowCode` varchar(64) COMMENT '窗口编号',
PRIMARY KEY (`id`)
,KEY `year` (`year`) USING BTREE
,KEY `windowId` (`windowId`) USING BTREE
,KEY `ownerId` (`ownerId`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='大厅窗口考核登记信息';
,KEY `windowName` (`windowName`) USING BTREE
,KEY `deptName` (`deptName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='窗口考核登记';
-- ----------------------------
-- 窗口人员考核汇总登记表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_window_workman_perform`;
CREATE TABLE mortals_xhx_window_workman_perform(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
......@@ -989,12 +997,14 @@ CREATE TABLE mortals_xhx_window_workman_perform(
`createTime` datetime COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
`windowCode` varchar(64) COMMENT '窗口编号',
PRIMARY KEY (`id`)
,KEY `year` (`year`) USING BTREE
,KEY `windowId` (`windowId`) USING BTREE
,KEY `ownerId` (`ownerId`) USING BTREE
,KEY `windowName` (`windowName`) USING BTREE
,KEY `deptName` (`deptName`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='窗口人员考核汇总登记';
DROP TABLE IF EXISTS `mortals_xhx_window_workman_perform_detail`;
CREATE TABLE mortals_xhx_window_workman_perform_detail(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
......
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