Commit 638fb867 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 6496103d 6eea5b45
...@@ -44,7 +44,13 @@ ...@@ -44,7 +44,13 @@
class="el-upload-list__item ele-upload-list__item-content" class="el-upload-list__item ele-upload-list__item-content"
v-for="(file, index) in list" v-for="(file, index) in list"
> >
<el-link :href="baseUrl + file.url" :underline="false" target="_blank"> <el-link
:href="
file.url[0].indexOf('https') == -1 ? baseUrl + file.url : file.url
"
:underline="false"
target="_blank"
>
<span class="el-icon-document" style="font-size: 12px"> <span class="el-icon-document" style="font-size: 12px">
{{ getFileName(file.name) }} {{ getFileName(file.name) }}
</span> </span>
...@@ -145,15 +151,23 @@ export default { ...@@ -145,15 +151,23 @@ export default {
list() { list() {
let temp = 1; let temp = 1;
if (this.value) { if (this.value) {
console.log("value", this.value);
// 首先将值转为数组 // 首先将值转为数组
const list = Array.isArray(this.value) ? this.value : [this.value]; const list = Array.isArray(this.value) ? this.value : [this.value];
list &&
list.forEach((v) => {
v.url.indexOf("https") >= 0 ? (v.url = JSON.parse(v.url)) : v.url;
});
// 然后将数组转为对象数组 // 然后将数组转为对象数组
this.fileList = list.map((item) => { this.fileList = list.map((item) => {
item = { name: item.name, url: item.url }; item = {
name: item.name,
url:
item.url.indexOf("[`\`") >= 0 ? JSON.parse(item.url) : item.url,
};
item.uid = item.uid || new Date().getTime() + temp++; item.uid = item.uid || new Date().getTime() + temp++;
return item; return item;
}); });
return this.fileList; return this.fileList;
} else { } else {
this.fileList = []; this.fileList = [];
......
...@@ -164,7 +164,7 @@ export default { ...@@ -164,7 +164,7 @@ export default {
prop: "auditResult", prop: "auditResult",
formatter: this.formatter, formatter: this.formatter,
}, },
{ label: "审批负责人", prop: "approver" }, // { label: "审批负责人", prop: "approver" },
{ {
label: "创建用户", label: "创建用户",
......
<template> <template>
<div class="page"> <div class="page">
<div class="btn_box" style="position: absolute;top: 52px;left: 10px;"> <div class="btn_box" style="position: absolute;top: 54px;left: 10px;">
<el-radio-group v-model="radio1" @input="changeRadio"> <el-radio-group v-model="radio1" @input="changeRadio">
<el-radio-button label="1">窗口考核</el-radio-button> <el-radio-button label="1">窗口考核</el-radio-button>
<el-radio-button label="2">工作人员考核</el-radio-button> <el-radio-button label="2">工作人员考核</el-radio-button>
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
doExport() { doExport() {
this.isExport = true; this.isExport = true;
this.$download( this.$download(
"/check/review/record/exportExcel", "/check/window/perform/exportExcel",
{ {
page: 1, page: 1,
size: -1, size: -1,
...@@ -66,7 +66,6 @@ export default { ...@@ -66,7 +66,6 @@ export default {
}, },
// 切换表格 // 切换表格
changeRadio() { changeRadio() {
console.log(this.radio1);
this.radio1 == 2 this.radio1 == 2
? this.$router.push("/check/window/workman/perform/list?page=1") ? this.$router.push("/check/window/workman/perform/list?page=1")
: ""; : "";
...@@ -80,49 +79,68 @@ export default { ...@@ -80,49 +79,68 @@ export default {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
{ {
name: "year", name: "deptId",
type: "text", type: "select",
label: "考核年度", label: "所属部门",
fuzzy: true, fuzzy: false,
}, },
{ {
name: "windowId", name: "checkStatus",
type: "text", type: "select",
label: "窗口ID", label: "核查状态",
fuzzy: true, fuzzy: false,
},
{
name: "createTimeMonth",
type: "month",
label: "请选择月份",
fuzzy: false,
}, },
{ {
name: "ownerId", name: "ownerName",
type: "text", type: "text",
label: "窗口负责人id", width: 200,
fuzzy: true, label: "窗口负责人姓名搜索",
fuzzy: false,
}, },
], ],
columns: [ columns: [
{ type: "selection", width: 60 }, { type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50 },
{ label: "窗口负责人", prop: "ownerName" },
{ {
label: "管理组核查时间", label: "登记年月",
prop: "manageCheckTime", formatter: (row) => {
formatter: this.formatterDate, return `${row.year ? row.year : "--"}-${
row.month
? [1, 2, 3, 4, 5, 6, 7, 8, 9].includes(row.month)
? "0" + row.month
: row.month
: "--"
}`;
},
}, },
{ label: "管理组核查说明", prop: "manageCheckDesc" }, { label: "所属大厅", prop: "salaName" },
{ label: "管理组核查结果", prop: "manageCheckResult" },
{ {
label: "领导组核查时间", label: "所属部门",
prop: "leaderCheckTime", prop: "deptName",
formatter: this.formatterDate,
}, },
{ label: "领导组核查说明", prop: "leaderCheckDesc" }, { label: "考核窗口", prop: "windowName" },
{ label: "领导组核查结果", prop: "leaderCheckResult" }, { label: "表单名称", prop: "fromName" },
{ label: "总分分值", prop: "sumScore", formatter: this.formatter },
{
label: "提交时间",
prop: "submitDate",
formatter: this.formatterDate,
},
{ label: "处理状态", prop: "checkStatus", formatter: this.formatter }, { label: "处理状态", prop: "checkStatus", formatter: this.formatter },
{ {
label: "操作", label: "操作",
width: 240, width: 240,
...@@ -130,6 +148,10 @@ export default { ...@@ -130,6 +148,10 @@ export default {
return ( return (
<table-buttons <table-buttons
noAdd noAdd
noDel
noEdit
reCheck
text={"自评核查"}
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
<template> <template>
<div class="page"> <div class="page">
<div class="btn_box" style="position: absolute;top: 52px;left: 10px;"> <div class="btn_box" style="position: absolute;top: 54px;left: 10px;">
<el-radio-group v-model="radio1" @input="changeRadio"> <el-radio-group v-model="radio1" @input="changeRadio">
<el-radio-button label="1">窗口考核</el-radio-button> <el-radio-button label="1">窗口考核</el-radio-button>
<el-radio-button label="2">工作人员考核</el-radio-button> <el-radio-button label="2">工作人员考核</el-radio-button>
...@@ -33,8 +33,7 @@ export default { ...@@ -33,8 +33,7 @@ export default {
}, },
mixins: [table], mixins: [table],
created() { created() {
console.log(123); // this.getData();
this.getData();
}, },
methods: { methods: {
/** 重写新增方法 */ /** 重写新增方法 */
...@@ -53,7 +52,7 @@ export default { ...@@ -53,7 +52,7 @@ export default {
doExport() { doExport() {
this.isExport = true; this.isExport = true;
this.$download( this.$download(
"/check/review/record/exportExcel", "/check/window/workman/perform/exportExcel",
{ {
page: 1, page: 1,
size: -1, size: -1,
...@@ -81,25 +80,75 @@ export default { ...@@ -81,25 +80,75 @@ export default {
isshowTabPane: true, isshowTabPane: true,
search: [ search: [
{ {
name: "year", name: "deptId",
type: "select",
label: "所属部门",
fuzzy: false,
},
{
name: "checkStatus",
type: "select",
label: "核查状态",
fuzzy: false,
},
{
name: "createTimeMonth",
type: "month",
label: "请选择月份",
fuzzy: false,
},
{
name: "ownerName",
type: "text", type: "text",
label: "考核年度", width: 200,
fuzzy: true, label: "窗口负责人姓名搜索",
fuzzy: false,
}, },
], ],
columns: [ columns: [
{ type: "selection", width: 60 }, { type: "selection", width: 60 },
{ type: "index", label: "序号", width: 50 }, { type: "index", label: "序号", width: 50 },
{ label: "窗口负责人", prop: "ownerName" },
{ {
label: "管理组核查时间", label: "登记年月",
prop: "manageCheckTime", formatter: (row) => {
formatter: this.formatterDate, return `${row.year ? row.year : "--"}-${
row.month
? [1, 2, 3, 4, 5, 6, 7, 8, 9].includes(row.month)
? "0" + row.month
: row.month
: "--"
}`;
},
}, },
{ label: "管理组核查说明", prop: "manageCheckDesc" }, { label: "所属大厅", prop: "salaName" },
{
label: "所属部门",
prop: "deptName",
},
{ label: "考核窗口", prop: "windowName" },
{ label: "表单名称", prop: "fromName" },
{ label: "总分分值", prop: "sumScore", formatter: this.formatter },
{
label: "提交时间",
prop: "submitDate",
width: 110,
formatter: this.formatterDate,
},
{
label: "最新核查时间",
prop: "updateTime",
width: 150,
formatter: this.formatterDate,
},
{ label: "处理状态", prop: "checkStatus", formatter: this.formatter },
{ label: "管理组核查结果", prop: "manageCheckResult" },
{ {
label: "操作", label: "操作",
width: 240, width: 240,
...@@ -107,6 +156,10 @@ export default { ...@@ -107,6 +156,10 @@ export default {
return ( return (
<table-buttons <table-buttons
noAdd noAdd
noDel
noEdit
reCheck
text={"自评核查"}
row={row} row={row}
onEdit={this.toEdit} onEdit={this.toEdit}
onView={this.toView} onView={this.toView}
......
package com.mortals.xhx.base.login.sms;
import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context;
import com.mortals.framework.service.IAuthTokenService;
import com.mortals.framework.util.DateUtils;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
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.HashMap;
import java.util.Map;
@RestController
@RequestMapping("sms")
public class SMSLoginController extends BaseJsonBodyController {
@Autowired
private UserService userService;
@Autowired
private IAuthTokenService authTokenService;
@PostMapping({"send"})
@UnAuth
public Rest<Object> sendSmsVerifyCode(@RequestBody SMSLoginPdu smsLoginPdu){
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
Context context = this.getContext();
String busiDesc = "发送手机验证码";
int code=1;
try {
userService.sendSmsVerifyCode(smsLoginPdu.getMobileNumber());
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
@PostMapping("login")
@UnAuth
public String login(@RequestBody SMSLoginPdu smsLoginPdu) throws Exception {
JSONObject ret = new JSONObject();
Map<String, Object> data = new HashMap<>();
String ip = super.getRequestIP(request);
UserEntity userEntity = null;
try {
userEntity = userService.doSmsLogin(smsLoginPdu.getMobileNumber(), smsLoginPdu.getVerifyCode(), ip);
userEntity.setLastLoginAddress(ip);
userEntity.setLoginTime(System.currentTimeMillis());
userEntity.setToken(IdUtil.fastSimpleUUID());
userEntity.setExpireTime(DateUtils.addCurrDate(7).getTime());
String token = authTokenService.createToken(userEntity);
data.put("token", token);
data.put("customer", userEntity);
recordSysLog(request, userEntity, "登录系统成功!");
ret.put(KEY_RESULT_DATA, data);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_SUCCESS);
ret.put(KEY_RESULT_MSG, "用户登录系统成功!");
return ret.toJSONString();
} catch (Exception e) {
log.error("login error ", e);
ret.put(KEY_RESULT_CODE, VALUE_RESULT_FAILURE);
ret.put(KEY_RESULT_MSG, super.convertException(e));
return ret.toJSONString();
}
}
}
package com.mortals.xhx.base.login.sms;
import lombok.Data;
@Data
public class SMSLoginPdu {
/** 手机号码 */
private String mobileNumber;
/** 验证码 */
private String verifyCode;
}
...@@ -117,4 +117,21 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> { ...@@ -117,4 +117,21 @@ public interface UserService extends ICRUDCacheService<UserEntity,Long> {
UserDao getUserDao(); UserDao getUserDao();
/**
* 发送手机验证码
* @param mobileNumber
* @throws AppException
*/
void sendSmsVerifyCode(String mobileNumber) throws AppException;
/**
* 手机验证码登录
* @param mobileNumber
* @param verifyCode
* @param loginIp
* @return
* @throws AppException
*/
UserEntity doSmsLogin(String mobileNumber, String verifyCode, String loginIp) throws AppException;
} }
\ No newline at end of file
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
package com.mortals.xhx.base.system.user.service.impl; package com.mortals.xhx.base.system.user.service.impl;
import cn.hutool.core.util.PhoneUtil;
import cn.hutool.core.util.RandomUtil;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.ap.SysConstains; import com.mortals.framework.ap.SysConstains;
import com.mortals.framework.common.code.UserType; import com.mortals.framework.common.code.UserType;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
...@@ -16,6 +19,7 @@ import com.mortals.framework.model.PageInfo; ...@@ -16,6 +19,7 @@ import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result; import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDCacheServiceImpl;
import com.mortals.framework.util.HttpUtil;
import com.mortals.framework.util.SecurityUtil; import com.mortals.framework.util.SecurityUtil;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
import com.mortals.xhx.base.system.menu.model.MenuEntity; import com.mortals.xhx.base.system.menu.model.MenuEntity;
...@@ -31,6 +35,7 @@ import com.mortals.xhx.base.system.user.model.UserQuery; ...@@ -31,6 +35,7 @@ import com.mortals.xhx.base.system.user.model.UserQuery;
import com.mortals.xhx.base.system.user.service.UserService; import com.mortals.xhx.base.system.user.service.UserService;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.*; import java.util.*;
...@@ -55,6 +60,16 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -55,6 +60,16 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
@Autowired @Autowired
private RoleUserDao roleUserDao; private RoleUserDao roleUserDao;
@Value("${sms.smsSendUrl:http://sms.wx3.com.cn/api/index/index}")
private String smsApiUrl;
@Value("${sms.apiId:ADsUXLrS81vZDU95}")
private String appid;
/** 短信模板ID**/
private static String SMS_TPYE = "30";
private static String SMS_VERIFY_CODE_KEY ="login:sms:verify:";
@Override @Override
protected String getExtKey(UserEntity data) { protected String getExtKey(UserEntity data) {
return data.getLoginName(); return data.getLoginName();
...@@ -347,4 +362,74 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE ...@@ -347,4 +362,74 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
return this.getDao(); return this.getDao();
} }
@Override
public void sendSmsVerifyCode(String mobileNumber) throws AppException {
if(StringUtils.isEmpty(mobileNumber)){
throw new AppException("手机号不能为空");
}
if(!PhoneUtil.isPhone(mobileNumber)){
throw new AppException("手机号码格式不正确");
}
UserEntity user = this.selectOne(new UserQuery().mobile(mobileNumber));
if(user==null){
throw new AppException("手机号码:" + mobileNumber + "没有注册用户");
}
String verifyCode = cacheService.get(SMS_VERIFY_CODE_KEY + mobileNumber);
if(StringUtils.isNotEmpty(verifyCode)){
throw new AppException("当前手机号码已发送验证码,请稍后重试");
}
try {
Map<String, String> params = new HashMap<>();
params.put("appid",appid);
params.put("phone",mobileNumber);
params.put("type",SMS_TPYE);
String[] json = new String[2];
String vCode = RandomUtil.randomNumbers(6);
json[0] = vCode;
json[1] = "1";
params.put("json", JSONObject.toJSON(json).toString());
String resp = HttpUtil.doPost(smsApiUrl,params);
JSONObject respJson = JSONObject.parseObject(resp);
if(respJson.getIntValue("code")==0){
throw new AppException("短信发送失败:" + respJson.getString("message"));
}
//有效期60秒
cacheService.setnx(SMS_VERIFY_CODE_KEY+mobileNumber,vCode,60);
}catch (Exception e){
log.error("短信发送异常",e);
throw new AppException("短信发送异常");
}
}
@Override
public UserEntity doSmsLogin(String mobileNumber, String verifyCode, String loginIp) throws AppException {
if(StringUtils.isEmpty(mobileNumber)){
throw new AppException("手机号不能为空");
}
if(StringUtils.isEmpty(verifyCode)){
throw new AppException("验证码不能为空");
}
if(!PhoneUtil.isPhone(mobileNumber)){
throw new AppException("手机号码格式不正确");
}
UserEntity customer = this.selectOne(new UserQuery().mobile(mobileNumber));
if(customer==null){
throw new AppException("手机号码:" + mobileNumber + "没有注册用户");
}
String vCode = cacheService.get(SMS_VERIFY_CODE_KEY + mobileNumber);
if(StringUtils.isEmpty(vCode)){
throw new AppException("验证码已失效");
}
if(!verifyCode.equals(vCode)){
throw new AppException("验证码不正确");
}
UserEntity update = new UserEntity();
update.setId(customer.getId());
update.setLastLoginAddress(loginIp);
update.setLastLoginTime(new Date());
this.update(update);
return customer;
}
} }
\ No newline at end of file
...@@ -155,11 +155,11 @@ public class CheckWindowPerformEntity extends CheckWindowPerformVo { ...@@ -155,11 +155,11 @@ public class CheckWindowPerformEntity extends CheckWindowPerformVo {
this.sumScore = BigDecimal.ZERO; this.sumScore = BigDecimal.ZERO;
this.submitDate = new Date(); this.submitDate = new Date();
this.manageCheckPerson = ""; this.manageCheckPerson = "";
this.manageCheckTime = new Date(); this.manageCheckTime = null;
this.manageCheckDesc = ""; this.manageCheckDesc = "";
this.manageCheckResult = ""; this.manageCheckResult = "";
this.leaderCheckPerson = ""; this.leaderCheckPerson = "";
this.leaderCheckTime = new Date(); this.leaderCheckTime = null;
this.leaderCheckDesc = ""; this.leaderCheckDesc = "";
this.leaderCheckResult = ""; this.leaderCheckResult = "";
this.checkStatus = 1; this.checkStatus = 1;
......
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData; import com.mortals.xhx.common.pdu.RespData;
...@@ -15,10 +16,7 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity; ...@@ -15,10 +16,7 @@ import com.mortals.xhx.module.window.model.WindowOwnerDetailEntity;
import com.mortals.xhx.module.window.service.WindowOwnerDetailService; import com.mortals.xhx.module.window.service.WindowOwnerDetailService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.ArrayList; import java.util.*;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -38,21 +36,18 @@ public class WindowOwnerDetailServiceImpl extends AbstractCRUDServiceImpl<Window ...@@ -38,21 +36,18 @@ public class WindowOwnerDetailServiceImpl extends AbstractCRUDServiceImpl<Window
@Override @Override
public List<WindowPdu> subWindowPduList(WindowPdu pdu) { public List<WindowPdu> subWindowPduList(WindowPdu pdu) {
List<WindowPdu> subList = new ArrayList<>(); List<WindowPdu> subList = new ArrayList<>();
if(pdu.getSiteId()==null){ List<WindowOwnerDetailEntity> ownerDetail = this.getAllList();
pdu.setSiteId(1l); //默认只查宜宾市民中心 if(!CollectionUtils.isEmpty(ownerDetail)){
} Long[] windows = ownerDetail.stream().map(WindowOwnerDetailEntity::getWindowId).toArray(Long[]::new);
pdu.setSize(-1); pdu.setIdNotList(Arrays.asList(windows));
Rest<RespData<List<WindowPdu>>> respDataRest = windowFeign.list(pdu); if(pdu.getSiteId()==null){
if (respDataRest.getCode() == YesNoEnum.YES.getValue()) { pdu.setSiteId(1l); //默认只查宜宾市民中心
List<WindowOwnerDetailEntity> ownerDetail = this.getAllList(); }
if(!CollectionUtils.isEmpty(ownerDetail)){ pdu.setSize(-1);
Map<Long,List<WindowOwnerDetailEntity>> windowMap = ownerDetail.stream().collect(Collectors.groupingBy(WindowOwnerDetailEntity::getWindowId)); Rest<RespData<List<WindowPdu>>> respDataRest = windowFeign.list(pdu);
List<WindowPdu> allWindow = respDataRest.getData().getData(); log.info(JSONObject.toJSONString(respDataRest));
for(WindowPdu item:allWindow){ if (respDataRest.getCode() == YesNoEnum.YES.getValue()) {
if(!windowMap.containsKey(item.getId())){ subList = respDataRest.getData().getData();
subList.add(item);
}
}
} }
} }
return subList; return subList;
......
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
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.WindowWorkmanPerformDetailEntity;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformDetailQuery;
import com.mortals.xhx.module.window.model.WindowWorkmanPerformEntity;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
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 +20,11 @@ import com.mortals.xhx.module.window.dao.WindowPerformDao; ...@@ -7,6 +20,11 @@ import com.mortals.xhx.module.window.dao.WindowPerformDao;
import com.mortals.xhx.module.window.model.WindowPerformEntity; import com.mortals.xhx.module.window.model.WindowPerformEntity;
import com.mortals.xhx.module.window.service.WindowPerformService; import com.mortals.xhx.module.window.service.WindowPerformService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/** /**
* WindowPerformService * WindowPerformService
* 大厅窗口信息 service实现 * 大厅窗口信息 service实现
...@@ -17,5 +35,43 @@ import lombok.extern.slf4j.Slf4j; ...@@ -17,5 +35,43 @@ import lombok.extern.slf4j.Slf4j;
@Service("windowPerformService") @Service("windowPerformService")
@Slf4j @Slf4j
public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerformDao, WindowPerformEntity, Long> implements WindowPerformService { public class WindowPerformServiceImpl extends AbstractCRUDServiceImpl<WindowPerformDao, WindowPerformEntity, Long> implements WindowPerformService {
@Autowired
private CheckWindowPerformService checkWindowPerformService;
@Override
protected void saveAfter(WindowPerformEntity entity, Context context) throws AppException {
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.saveAfter(entity, context);
}
@Override
protected void updateAfter(WindowPerformEntity entity, Context context) throws AppException {
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.updateAfter(entity, context);
}
@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);
super.removeAfter(ids, context, result);
}
private void saveToCheck(WindowPerformEntity entity){
CheckWindowPerformEntity perform = new CheckWindowPerformEntity();
perform.initAttrValue();
BeanUtils.copyProperties(entity, perform, BeanUtil.getNullPropertyNames(entity));
perform.setId(null);
perform.setRecordId(entity.getId());
perform.setFromName("市政务服务大厅窗口考核登记表");
perform.setSubmitDate(entity.getFillDate());
perform.setUpdateTime(null);
perform.setUpdateUserId(null);
checkWindowPerformService.save(perform);
}
} }
\ No newline at end of file
package com.mortals.xhx.module.window.service.impl; package com.mortals.xhx.module.window.service.impl;
import com.mortals.xhx.common.code.FillStatusEnum;
import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.check.model.CheckWindowPerformEntity;
import com.mortals.xhx.module.check.model.CheckWindowPerformQuery;
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.check.service.CheckWindowWorkmanPerformService;
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;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl; import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
...@@ -30,6 +39,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -30,6 +39,8 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
@Autowired @Autowired
private WindowWorkmanPerformDetailService windowWorkmanPerformDetailService; private WindowWorkmanPerformDetailService windowWorkmanPerformDetailService;
@Autowired
private CheckWindowWorkmanPerformService checkWindowWorkmanPerformService;
@Override @Override
...@@ -42,6 +53,9 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -42,6 +53,9 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
}); });
windowWorkmanPerformDetailService.save(entity.getWorkmanPerformDetailList()); windowWorkmanPerformDetailService.save(entity.getWorkmanPerformDetailList());
} }
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.saveAfter(entity, context); super.saveAfter(entity, context);
} }
...@@ -59,6 +73,9 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -59,6 +73,9 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
}); });
windowWorkmanPerformDetailService.save(entity.getWorkmanPerformDetailList()); windowWorkmanPerformDetailService.save(entity.getWorkmanPerformDetailList());
} }
if(entity.getFillStatus()== FillStatusEnum.提交.getValue()){
saveToCheck(entity);
}
super.updateAfter(entity, context); super.updateAfter(entity, context);
} }
...@@ -66,6 +83,21 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win ...@@ -66,6 +83,21 @@ public class WindowWorkmanPerformServiceImpl extends AbstractCRUDServiceImpl<Win
protected void removeAfter(Long[] ids, Context context, int result) throws AppException { protected void removeAfter(Long[] ids, Context context, int result) throws AppException {
List<WindowWorkmanPerformDetailEntity> detailEntities = windowWorkmanPerformDetailService.find(new WindowWorkmanPerformDetailQuery().performIdList(Arrays.asList(ids))); List<WindowWorkmanPerformDetailEntity> detailEntities = windowWorkmanPerformDetailService.find(new WindowWorkmanPerformDetailQuery().performIdList(Arrays.asList(ids)));
windowWorkmanPerformDetailService.removeList(detailEntities, context); windowWorkmanPerformDetailService.removeList(detailEntities, context);
List<CheckWindowWorkmanPerformEntity> performEntitys = checkWindowWorkmanPerformService.find(new CheckWindowWorkmanPerformQuery().recordIdList(Arrays.asList(ids)));
checkWindowWorkmanPerformService.removeList(performEntitys,context);
super.removeAfter(ids, context, result); super.removeAfter(ids, context, result);
} }
private void saveToCheck(WindowWorkmanPerformEntity entity){
CheckWindowWorkmanPerformEntity perform = new CheckWindowWorkmanPerformEntity();
perform.initAttrValue();
BeanUtils.copyProperties(entity, perform, BeanUtil.getNullPropertyNames(entity));
perform.setId(null);
perform.setRecordId(entity.getId());
perform.setFromName("市政务服务大厅窗口工作人员考核汇总表");
perform.setSubmitDate(entity.getFillDate());
perform.setUpdateTime(null);
perform.setUpdateUserId(null);
checkWindowWorkmanPerformService.save(perform);
}
} }
\ No newline at end of file
...@@ -3,6 +3,8 @@ package com.mortals.xhx.common.pdu.window; ...@@ -3,6 +3,8 @@ package com.mortals.xhx.common.pdu.window;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import lombok.Data; import lombok.Data;
import java.util.List;
@Data @Data
public class WindowPdu extends BaseEntityLong { public class WindowPdu extends BaseEntityLong {
/** /**
...@@ -87,4 +89,7 @@ public class WindowPdu extends BaseEntityLong { ...@@ -87,4 +89,7 @@ public class WindowPdu extends BaseEntityLong {
*/ */
private String hallName; private String hallName;
/** 序号,主键,自增长排除列表 */
private List<Long> idNotList;
} }
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