异常bug修改

赵嘉伟 4 years ago
parent 6cf8a3dc18
commit eb11ffa11f

@ -220,8 +220,7 @@ public class AbnormalBillController {
*/
@GetMapping("/cancelBrowse")
public R cancelBrowse(String handle, String cancelBrowse,String code){
abnormalBillService.cancelBrowse(handle,cancelBrowse,code);
return R.ok();
return R.ok( abnormalBillService.cancelBrowse(handle,cancelBrowse,code));
}
@GetMapping("/backLog")
@ -313,4 +312,9 @@ public class AbnormalBillController {
public R findUploadPictureByAbnormalBo(AbnormalBill abnormalBill){
return R.ok(abnormalBillService.findUploadPictureByAbnormalBo(abnormalBill));
}
@GetMapping("/clear")
public R clear(String type){
return R.ok(abnormalBillService.getNextNumber(type));
}
}

@ -49,7 +49,7 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
String generateAbnormalBill(AbnormalBill abnormalBill, AbnormalBillDispose abnormalBillDispose,List<String> dutyCauseType,List<String> dutyType);
void cancelBrowse(String handle,String cancelBrowse,String code);
boolean cancelBrowse(String handle,String cancelBrowse,String code);
String anomalyReportDevice(AbnormalBill abnormalBill,AbnormalBillDispose abnormalBillDispose);
@ -112,4 +112,11 @@ public interface AbnormalBillService extends IService<AbnormalBill> {
*/
public UploadPictures findUploadPictureByAbnormalBo(AbnormalBill abnormalBill);
/**
*
* @param type
* @return
*/
String getNextNumber(String type);
}

@ -13,7 +13,10 @@ import com.foreverwin.mesnac.common.constant.Constants;
import com.foreverwin.mesnac.common.enums.HandleEnum;
import com.foreverwin.mesnac.common.helper.NextNumberHelper;
import com.foreverwin.mesnac.common.util.StringUtil;
import com.foreverwin.mesnac.meapi.mapper.*;
import com.foreverwin.mesnac.meapi.mapper.NcGroupMapper;
import com.foreverwin.mesnac.meapi.mapper.NwaUserMapper;
import com.foreverwin.mesnac.meapi.mapper.ResrceMapper;
import com.foreverwin.mesnac.meapi.mapper.ShopOrderMapper;
import com.foreverwin.mesnac.meapi.model.*;
import com.foreverwin.mesnac.meapi.service.*;
import com.foreverwin.modular.core.exception.BusinessException;
@ -228,16 +231,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
hashMap.put("currentUser",nwaUsers.get(0).getFullName());
}
//初始化异常单号
String abnormalNo = null;
//生成异常单号
if("Q".equals(type)){//其他异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_OTHER", 1, null).get(0);
}else if("Z".equals(type)){//质量异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_QUALITY", 1, null).get(0);
}else if("S".equals(type)){//设备异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_DEVICE", 1, null).get(0);
}
hashMap.put("abnormalNo",abnormalNo);
hashMap.put("abnormalNo",this.getNextNumber(type));
return hashMap;
}
@ -278,6 +272,8 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
String user = "";
if(StringUtil.isBlank(abnormalBill.getResponseUser())){
user = CommonMethods.getUser();
}else {
user = abnormalBill.getResponseUser() + "," + CommonMethods.getUser();
}
LocalDateTime now = LocalDateTime.now();
abnormalBill.setSite(site);
@ -513,9 +509,12 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
@Override
public void cancelBrowse(String handle, String cancelBrowse,String code) {
public boolean cancelBrowse(String handle, String cancelBrowse,String code) {
LocalDateTime now = LocalDateTime.now();
AbnormalBill abnormalBill = abnormalBillMapper.selectById(handle);
if(abnormalBill == null){
return false;
}
abnormalBill.setStatus(Constants.CANCEL);
abnormalBill.setCancelReason(cancelBrowse);
if(!StringUtil.isBlank(code)){
@ -524,6 +523,7 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
abnormalBill.setCancelUser(CommonMethods.getUser());
abnormalBill.setCancelDateTime(now);
this.saveOrUpdate(abnormalBill);
return true;
}
@Override
@ -572,6 +572,21 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
}
return null;
}
@Override
public String getNextNumber(String type){
String site = CommonMethods.getSite();
String abnormalNo = "";
//生成异常单号
if("Q".equals(type)){//其他异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_OTHER", 1, null).get(0);
}else if("Z".equals(type)){//质量异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_QUALITY", 1, null).get(0);
}else if("S".equals(type)){//设备异常
abnormalNo = nextNumberHelper.getNextNumber(site, "ABNORMAL_DEVICE", 1, null).get(0);
}
return abnormalNo;
}
}

@ -820,7 +820,7 @@
,zab.CREATED_USER CREATED_USER,
zab.NC_CODE NC_CODE,zab.PB_DESCRIPTION PB_DESCRIPTION
FROM Z_ABNORMAL_BILL zab
INNER JOIN ITEM i ON zab.ITEM_BO = i.HANDLE
LEFT JOIN ITEM i ON zab.ITEM_BO = i.HANDLE
LEFT JOIN ITEM_T it ON i.HANDLE = it.ITEM_BO AND it.LOCALE = #{language}
<where>
<if test="abnormalBill != null">
@ -863,7 +863,7 @@
SELECT ZAB.ABNORMAL_NO ABNORMAL_NO , ZAB.STATUS STATUS ,ZAB.REPORT_FROM REPORT_FROM ,WCT.DESCRIPTION WORK_CENTER_DESCRIPTION,
ZAB.RESRCE RESRCE ,R.DESCRIPTION RESRCE_DESCRIPTION,ZNU.FULL_NAME REPORT_USER,ZAB.MESSAGE_TYPE MESSAGE_TYPE ,
ZAB.NC_CODE NC_CODE ,ZAB.PB_DESCRIPTION PB_DESCRIPTION ,ZAB.SHUT_DOWN SHUT_DOWN ,ZAB.RESPONSE_USER RESPONSE_USER,ZAB.RESPONSE_DATE_TIME RESPONSE_DATE_TIME,
ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,ZNU3.FULL_NAME CONFIRM_USER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,ZAB.CANCEL_USER,
ZABD.ABNORMAL_METHOD ABNORMAL_METHOD,ZNU3.FULL_NAME CONFIRM_USER,ZABD.RESOLVE_REMARK RESOLVE_REMARK,
ZAB.CANCEL_CODE CANCEL_CODE,ZAB.CANCEL_DATE_TIME CANCEL_DATE_TIME,ZNU4.FULL_NAME CANCEL_USER,ZAB.CANCEL_REASON CANCEL_REASON
FROM
Z_ABNORMAL_BILL ZAB
@ -873,7 +873,7 @@
LEFT JOIN Z_NWA_USER ZNU ON ZNU.USER_NAME = ZAB.CREATED_USER AND ZNU.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU2 ON ZNU2.USER_NAME = ZAB.RESPONSE_USER AND ZNU2.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU3 ON ZNU3.USER_NAME = ZABD.RESOLVE_USER AND ZNU3.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU4 ON ZNU4.USER_NAME = ZAB.CANCEL_CODE AND ZNU4.SITE = ZAB.SITE
LEFT JOIN Z_NWA_USER ZNU4 ON ZNU4.USER_NAME = ZAB.CANCEL_USER AND ZNU4.SITE = ZAB.SITE
<where>
<if test="abnormalBill != null">
<if test="abnormalBill.site != null and abnormalBill.site != ''">

@ -25,6 +25,20 @@ public interface Constants {
String CANCEL = "Q";
String SHUT_DOWN = "G";
//异常单上报来源
String REPORT = "B"; // 自报
String QUALITY_INSPECTION = "J"; //质检
String DEVCICE_USER = "R";//设备人员
String DEVICE_AUTO = "Z";//设备自动
String REPAIR_CHECK = "C";// 维修自查
String TECHNOLOGY = "Y";//工艺
//异常单发现环节
String SELF_MADE = "Z";//自制
String OUTSOURCING = "W";//外协
String ARRIVAL = "D";//到货
String CUSTOMER = "K";//客户
//任务编号常量
String RESOURCE_INSPECT_TASK = "RESOURCE_INSPECT_TASK";
//报修任务单号

@ -2,9 +2,7 @@ package com.foreverwin.minth.generator;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.foreverwin.minth.generator.converts.HanaTypeConvert;
import com.foreverwin.minth.generator.converts.OracleTypeConvert;
import com.foreverwin.minth.generator.querys.HanaQuery;
/**
* @author Ervin Chen
@ -33,8 +31,8 @@ public class GeneratorApplication {
dataSourceConfig.setTypeConvert( new OracleTypeConvert() );
MpGenerator mpGenerator = mpGeneratorBuilder.dataSourceConfig(dataSourceConfig)
.tablePrefix( "APS_", "DS_", "Z_" )
.packageName( "com.foreverwin.mesnac.dispatch" )
.tables("Z_SURPLUS_ITEM_RETURN")
.packageName( "com.foreverwin.mesnac.anomaly" )
.tables("Z_UPLOAD_PICTURES")
.author("Leon.L")
.uiAppId("com.foreverwin.me")
.uiPackage("com.foreverwin.me.migration")

@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.meapi.model.NwaUser;
import com.foreverwin.mesnac.meapi.service.NwaUserService;
import com.foreverwin.mesnac.meapi.util.StringUtils;
import com.foreverwin.modular.core.util.CommonMethods;
import com.foreverwin.modular.core.util.FrontPage;
import com.foreverwin.modular.core.util.R;
@ -48,6 +49,12 @@ public class NwaUserController {
public R getNwaUserList(NwaUser nwaUser){
List<NwaUser> result;
QueryWrapper<NwaUser> queryWrapper = new QueryWrapper<>();
String site = CommonMethods.getSite();
nwaUser.setSite(site);
if(!StringUtils.isBlank(nwaUser.getUserName())){
queryWrapper.ne("USER_NAME",nwaUser.getUserName());
nwaUser.setUserName(null);
}
queryWrapper.setEntity(nwaUser);
result = nwaUserService.list(queryWrapper);
return R.ok(result);

@ -152,12 +152,12 @@
<if test="ew.entity.email!=null"> AND EMAIL=#{ew.entity.email}</if>
</if>
<if test="ew!=null and ew.sqlSegment!=null and ew.nonEmptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</if>
</where>
<if test="ew!=null and ew.sqlSegment!=null and ew.emptyOfWhere">
${ew.sqlSegment}
AND ${ew.sqlSegment}
</if>
</select>

Loading…
Cancel
Save