diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyDetails.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyDetails.java index bda93fd4..61caf1e1 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyDetails.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyDetails.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.base.api.domain; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -63,6 +64,12 @@ public class LeaseApplyDetails implements Serializable { @ApiModelProperty(value = "已领数量") private Double alNum; + /** + * 此数量是剩余需要出库的数量(preNum - alNum) + */ + @ApiModelProperty(value = "剩余最大出库数量") + private Double outNum; + /** 审批数量 */ @ApiModelProperty(value = "审批数量") private Double auditNum; @@ -84,6 +91,7 @@ public class LeaseApplyDetails implements Serializable { */ @ApiModelProperty(value = "创建时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** @@ -97,6 +105,7 @@ public class LeaseApplyDetails implements Serializable { */ @ApiModelProperty(value = "更新时间 ") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java index 54b0c615..a5238612 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseApplyInfo.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.base.api.domain; +import com.alibaba.fastjson2.annotation.JSONField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -121,6 +122,7 @@ public class LeaseApplyInfo implements Serializable { */ @ApiModelProperty(value = "创建时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** @@ -134,6 +136,7 @@ public class LeaseApplyInfo implements Serializable { */ @ApiModelProperty(value = "更新时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java index 3b7d6b19..80c088da 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/LeaseOutDetails.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.base.api.domain; +import com.alibaba.fastjson2.annotation.JSONField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -62,6 +63,7 @@ public class LeaseOutDetails implements Serializable { /** 创建时间 */ @ApiModelProperty(value = "创建时间") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** 更新者 */ @@ -70,6 +72,7 @@ public class LeaseOutDetails implements Serializable { /** 更新时间 */ @ApiModelProperty(value = "更新时间") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** 备注 */ diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/TmTask.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/TmTask.java index 0f8df389..f99861d4 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/TmTask.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/TmTask.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.base.api.domain; +import com.alibaba.fastjson2.annotation.JSONField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -83,6 +84,7 @@ public class TmTask implements Serializable { */ @ApiModelProperty(value="创建时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date createTime; /** @@ -96,6 +98,7 @@ public class TmTask implements Serializable { */ @ApiModelProperty(value="更新时间") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @JSONField(format = "yyyy-MM-dd HH:mm:ss") private Date updateTime; /** @@ -197,7 +200,6 @@ public class TmTask implements Serializable { @ApiModelProperty(value="公司审批备注") private String companyAuditRemark; - @ApiModelProperty(value="分管审批人") private String deptAuditBy; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java new file mode 100644 index 00000000..17c6cfbb --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackReceiveController.java @@ -0,0 +1,155 @@ +package com.bonus.sgzb.app.controller; + +import com.bonus.sgzb.app.domain.BackApplyInfo; +import com.bonus.sgzb.app.domain.BmAgreementInfo; +import com.bonus.sgzb.app.service.*; +import com.bonus.sgzb.base.api.domain.TmTask; +import com.bonus.sgzb.common.core.utils.DateUtils; +import com.bonus.sgzb.common.core.utils.StringUtils; +import com.bonus.sgzb.common.core.web.controller.BaseController; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.log.annotation.Log; +import com.bonus.sgzb.common.log.enums.BusinessType; +import io.swagger.annotations.ApiOperation; +import org.aspectj.weaver.loadtime.Aj; +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 javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * 退料接收 + */ +@RestController +@RequestMapping("/backReceive") +public class BackReceiveController extends BaseController { + + @Resource + private BackReceiveService backReceiveService; // 任务表Service + + /** + * 服务对象 + */ + @Resource + private TmTaskService tmTaskService; // 任务表Service + + /** + * 退料接收列表 + * + * @param record 查询条件 + * @return AjaxResult对象 + */ + @Log(title = "退料接收列表", businessType = BusinessType.QUERY) + @PostMapping("getbackReceiveList") + public AjaxResult getbackReceiveList(@RequestBody BackApplyInfo record) { + try { + List list =backReceiveService.getbackReceiveList(record); + return success(list); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + + /** + * 退料接收明细 + * + * @param record 查询条件 + * @return AjaxResult对象 + */ + @Log(title = "退料接收明细", businessType = BusinessType.QUERY) + @PostMapping("receiveView") + public AjaxResult receiveView(@RequestBody BackApplyInfo record) { + try { + List list =backReceiveService.receiveView(record); + return success(list); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + + /** + * 数量退料--管理方式为1的 + * + * @param record 查询条件 + * @return AjaxResult对象 + */ + @Log(title = "退料接收-数量退料", businessType = BusinessType.INSERT) + @PostMapping("setNumBack") + public AjaxResult setNumBack(@RequestBody BackApplyInfo record) { + try { + int res =backReceiveService.setNumBack(record); + if (res>0){ + return AjaxResult.success("接收成功"); + }else { + return AjaxResult.error("接收失败"); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + /** + * 数量退料--管理方式为1的 + * + * @param record 查询条件 + * @return AjaxResult对象 + */ + @Log(title = "退料接收-编码退料", businessType = BusinessType.INSERT) + @PostMapping("setCodeBack") + public AjaxResult setCodeBack(@RequestBody BackApplyInfo record) { + try { + int res =backReceiveService.setCodeBack(record); + if (res>0){ + return AjaxResult.success("接收成功"); + }else { + return AjaxResult.error("接收失败"); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + @Log(title = "退料接收-结束任务", businessType = BusinessType.INSERT) + @PostMapping("endBack") + public AjaxResult endBack(@RequestBody BackApplyInfo record) { + try { + int res =backReceiveService.endBack(record); + if (res>0){ + return AjaxResult.success("接收成功"); + }else { + return AjaxResult.error("接收失败"); + } + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + @Log(title = "退料接收-编号查询", businessType = BusinessType.INSERT) + @PostMapping("codeQuery") + public AjaxResult codeQuery(@RequestBody BackApplyInfo record) { + try { + List list =backReceiveService.codeQuery(record); + return AjaxResult.success(list); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + @Log(title = "退料接收-二维码查询", businessType = BusinessType.INSERT) + @PostMapping("qrcodeQuery") + public AjaxResult qrcodeQuery(@RequestBody BackApplyInfo record) { + try { + List list =backReceiveService.qrcodeQuery(record); + return AjaxResult.success(list); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java index ac5b9e51..ad0a4a98 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/domain/BackApplyInfo.java @@ -138,4 +138,10 @@ public class BackApplyInfo { private BackApplyInfo info; private BackApplyInfo[] arr; + private Integer parentId; + private String sdStatus; + private String qrCode; + private String repairedNum; + private String backId; + private String repairer; } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java new file mode 100644 index 00000000..f52d5d03 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/BackReceiveMapper.java @@ -0,0 +1,58 @@ +package com.bonus.sgzb.app.mapper; + +import com.bonus.sgzb.app.domain.BackApplyInfo; +import com.bonus.sgzb.app.domain.BmAgreementInfo; +import com.bonus.sgzb.base.api.domain.TmTask; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + + +@Mapper +public interface BackReceiveMapper { + + List getbackReceiveList(BackApplyInfo record); + + List receiveView(BackApplyInfo record); + + /** + * 添加退料合格数量 + */ + int setCheckDetails(BackApplyInfo record); + + int insertCheckDetails(BackApplyInfo record); + + int selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType); + + int addWxTask(BackApplyInfo bean); + + int addWxTaskAgreement(BackApplyInfo bean); + + int updateTaskStatus(@Param("taskId") int taskId, @Param("status") int status); + + int updateMaStatus(@Param("maId") int maId,@Param("maStatus") String maStatus); + + List getHgList(BackApplyInfo record); + + int insertIAD(BackApplyInfo bi); + + int updateMT(BackApplyInfo bi); + + List getWxList(BackApplyInfo record); + + int insertTT(BackApplyInfo bean); + + int insertRAD(BackApplyInfo wx); + + int insertTTA(@Param("taskId") int taskId,@Param("agreementId") String agreementId); + + List getBfList(BackApplyInfo record); + + int insertSAD(BackApplyInfo bf); + + List codeQuery(BackApplyInfo record); + + List qrcodeQuery(BackApplyInfo record); +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java new file mode 100644 index 00000000..b949c0b8 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/BackReceiveService.java @@ -0,0 +1,24 @@ +package com.bonus.sgzb.app.service; + +import com.bonus.sgzb.app.domain.BackApplyInfo; +import com.bonus.sgzb.app.domain.BmAgreementInfo; +import com.bonus.sgzb.base.api.domain.TmTask; + +import java.util.List; + +public interface BackReceiveService { + + List getbackReceiveList(BackApplyInfo record); + + List receiveView(BackApplyInfo record); + + int setNumBack(BackApplyInfo record); + + int setCodeBack(BackApplyInfo record); + + int endBack(BackApplyInfo record); + + List codeQuery(BackApplyInfo record); + + List qrcodeQuery(BackApplyInfo record); +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java new file mode 100644 index 00000000..6f87aee1 --- /dev/null +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/BackReceiveServiceImpl.java @@ -0,0 +1,300 @@ +package com.bonus.sgzb.app.service.impl; + +import com.bonus.sgzb.app.domain.BackApplyInfo; +import com.bonus.sgzb.app.domain.BmAgreementInfo; +import com.bonus.sgzb.app.mapper.BackApplyMapper; +import com.bonus.sgzb.app.mapper.BackReceiveMapper; +import com.bonus.sgzb.app.service.BackApplyService; +import com.bonus.sgzb.app.service.BackReceiveService; +import com.bonus.sgzb.base.api.domain.TmTask; +import com.bonus.sgzb.common.core.utils.DateUtils; +import com.bonus.sgzb.common.core.utils.StringUtils; +import org.apache.poi.util.StringUtil; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + + +@Service +public class BackReceiveServiceImpl implements BackReceiveService { + + @Resource + private BackReceiveMapper backReceiveMapper; + + + @Override + public List getbackReceiveList(BackApplyInfo record) { + return backReceiveMapper.getbackReceiveList(record); + } + + @Override + public List receiveView(BackApplyInfo record) { + return backReceiveMapper.receiveView(record); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int setNumBack(BackApplyInfo record) { + int res =0; + try{ + int taskId = record.getTaskId(); + //修改任务状态 + res= updateTaskStatus(taskId,39); + //插入back_check_details + res = insertBCD(record); + if(res == 0) { + throw new RuntimeException("插入back_check_details异常"); + } + }catch (Exception e){ + throw new RuntimeException(e.getMessage()); + } + + return res; + } + + private int updateTaskStatus(int taskId, int i) { + int res=0; + res=backReceiveMapper.updateTaskStatus(taskId,i); + return res; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int setCodeBack(BackApplyInfo record) { + int res = 0; + try{ + int taskId = record.getTaskId(); + //修改任务状态 + res= updateTaskStatus(taskId,39); + if(res == 0) { + throw new RuntimeException("插入back_check_details异常"); + } + //插入back_check_details + res = insertBCD(record); + if(res == 0) { + throw new RuntimeException("插入back_check_details异常"); + } + }catch (Exception e){ + throw new RuntimeException(e.getMessage()); + } + return res; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public int endBack(BackApplyInfo record) { + int res =0; + try{ + int taskId = record.getTaskId(); + //修改任务状态 + res= updateTaskStatus(taskId,40); + if(res == 0) { + throw new RuntimeException("插入back_check_details异常"); + } + //更加退料接收的数据创建下一步流程 + //合格的插入入库记录input_apply_details,修改库存ma_type,修改机具状态 + List hgList = backReceiveMapper.getHgList(record); + if(hgList!=null && hgList.size()>0){ + res = insertIAD(hgList); + if(res == 0) { + throw new RuntimeException("input_apply_details"); + } + res = updateMT(hgList); + if(res == 0) { + throw new RuntimeException("ma_type"); + } + res = updateMaStatus(hgList); + if(res == 0) { + throw new RuntimeException("ma_machines"); + } + } + //维修的创建维修任务,插入任务协议表 + List wxList = backReceiveMapper.getWxList(record); + if(wxList!=null && wxList.size()>0){ + //插入任务表tm_task + int newTaskId = insertTT(hgList,41); + //插入协议任务表tm_task_agreement + res = insertTTA(taskId,wxList); + //插入维修记录表repair_apply_details + res = insertRAD(taskId,wxList); + } + //待报废的创建报废任务,插入任务协议表 + + List bfList = backReceiveMapper.getBfList(record); + if(wxList!=null && wxList.size()>0){ + //插入任务表tm_task + int newTaskId = insertTT(hgList,57); + //插入协议任务表tm_task_agreement + res = insertTTA(taskId,hgList); + //插入维修记录表scrap_apply_details + res = insertSAD(taskId,hgList); + } + + + + }catch (Exception e){ + throw new RuntimeException(e.getMessage()); + } + + return 0; + } + + @Override + public List codeQuery(BackApplyInfo record) { + + return backReceiveMapper.codeQuery(record); + } + + @Override + public List qrcodeQuery(BackApplyInfo record) { + return backReceiveMapper.qrcodeQuery(record); + } + + private int insertRAD(int taskId, List wxList) { + + int result = 0; + if(wxList !=null){ + for( BackApplyInfo wx : wxList ){ + wx.setTaskId(taskId); + result = backReceiveMapper.insertRAD(wx); + } + + } + return result; + } + + private int insertSAD(int taskId, List list) { + int result = 0; + if(list !=null){ + for( BackApplyInfo bf : list ){ + bf.setTaskId(taskId); + result = backReceiveMapper.insertSAD(bf); + } + + } + return result; + } + + private int insertTTA(int taskId, List list) { + int res = 0 ; + String agreementId = list.get(0).getAgreementId(); + res = backReceiveMapper.insertTTA(taskId,agreementId); + return res; + } + + private int insertTT(List hgList, int taskType) { + int newTask = 0; + + //生成单号 + String code = genCodeRule(taskType); + + BackApplyInfo applyInfo = new BackApplyInfo(); + applyInfo.setTaskType(taskType); + String taskStatus=""; + if(41 == taskType){ + taskStatus = "42"; + } + if(57 == taskType){ + taskStatus = "58"; + } + applyInfo.setTaskStatus(taskStatus); + applyInfo.setCode(code); + //创建人 + newTask = backReceiveMapper.insertTT(applyInfo); + return newTask; + } + + + private int updateMaStatus(List hgList) { + int res =0; + if(hgList!=null && hgList.size()>0){ + for(BackApplyInfo bi : hgList){ + Integer maId = bi.getMaId(); + if(maId == null){ + + }else{ + res = backReceiveMapper.updateMaStatus(maId,"15"); + } + + } + } + return res; + } + + private int updateMT(List hgList) { + int res =0; + if(hgList!=null && hgList.size()>0){ + for(BackApplyInfo bi : hgList){ + res = backReceiveMapper.updateMT(bi); + } + } + return res; + } + + private int insertIAD(List hgList) { + int res =0; + if(hgList!=null && hgList.size()>0){ + for(BackApplyInfo bi : hgList){ + res = backReceiveMapper.insertIAD(bi); + } + } + return res; + } + + private int insertBCD(BackApplyInfo record) { + int res =0; + BackApplyInfo[] arr = record.getArr(); + if(arr.length>0){ + for(int i=0 ; i< arr.length;i++){ + res = backReceiveMapper.insertCheckDetails(arr[i]); + String manageType = arr[i].getManageType(); + if("0".equals(manageType)){ + String backStatus = arr[i].getBackStatus(); + int maId = arr[i].getMaId(); + if("1".equals(backStatus)){ + //退料合格状态变为退料带入库84 + backReceiveMapper.updateMaStatus(maId,"84"); + } + if("2".equals(backStatus)){ + //退料维修状态变为退料待检修17 + backReceiveMapper.updateMaStatus(maId,"17"); + } + if("3".equals(backStatus)){ + //退料待报废状态变为退料待报废20 + backReceiveMapper.updateMaStatus(maId,"20"); + } + } + } + } + + return res; + } + + + // 编号生成规则 + private String genCodeRule(int taskType) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); + Date nowDate = DateUtils.getNowDate(); + String format = dateFormat.format(nowDate); + int taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate,taskType) + 1; + String code=""; + if(41 == taskType){ + code = "WX"; + } + if(57 == taskType){ + code = "BF"; + } + if (taskNum>9 && taskNum<100){ + code = code + format + "-00" + taskNum; + }else if (taskNum>99 && taskNum<1000){ + code = code +format + "-0" + taskNum; + }else { + code = code + format + "-000" + taskNum; + } + return code; + } +} diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/util/CommonUtil.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/util/CommonUtil.java index 1d0162d5..73d6f2f7 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/util/CommonUtil.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/largeScreen/util/CommonUtil.java @@ -113,6 +113,9 @@ public class CommonUtil { BigDecimal jjValue = new BigDecimal(new Double(0).toString()); BigDecimal tsValue = new BigDecimal(new Double(0).toString()); for (int i = 0; i < list.size(); i++) { + if(Objects.isNull(list.get(i))){ + continue; + } if (Objects.equals(list.get(i).getCompanyName(), CommonConstants.JJ)) { BigDecimal value = new BigDecimal(new Double(list.get(i).getNum()).toString()); jjValue = jjValue.add(value); diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml index 43333387..73b4ed01 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackApplyMapper.xml @@ -341,8 +341,8 @@ LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id LEFT JOIN ma_type mt3 ON mt3.type_id=mt2.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id=mt3.parent_id - WHERE - bai.company_id=#{companyId} +# WHERE +# bai.company_id=#{companyId} GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time @@ -451,8 +451,9 @@ LEFT JOIN ma_type mt3 ON mt3.type_id=mt2.parent_id LEFT JOIN ma_type mt4 ON mt4.type_id=mt3.parent_id WHERE - bai.company_id=#{companyId} - and bad.type_id is not null +# bai.company_id=#{companyId} +# and + bad.type_id is not null GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time + SELECT + bai.id, + bai.`code`, + bai.task_id as taskId, + bai.back_person as backPerson, + bai.phone, + bpl.lot_id, + bpl.lot_name as lotName, + bui.unit_id as unitId, + bui.unit_name as unitName, + bai.back_time as backTime, + tt.task_status as taskStatus, + tta.agreement_id as agreementId, + GROUP_CONCAT(DISTINCT bad.type_id) as typeId, + GROUP_CONCAT(mt2.type_name, '') AS typeName + FROM + back_apply_info bai + LEFT JOIN back_apply_details bad on bad.parent_id=bai.id + LEFT JOIN tm_task tt on tt.task_id=bai.task_id + LEFT JOIN tm_task_agreement tta on tta.task_id=tt.task_id + LEFT JOIN bm_agreement_info bagi on bagi.agreement_id=tta.agreement_id + LEFT JOIN bm_project_lot bpl on bpl.lot_id=bagi.project_id + LEFT JOIN bm_unit_info bui on bui.unit_id=bagi.unit_id + LEFT JOIN sys_user us on us.user_id=bai.create_by + LEFT JOIN ma_type mt1 ON mt1.type_id=bad.type_id + LEFT JOIN ma_type mt2 ON mt2.type_id=mt1.parent_id + LEFT JOIN ma_type mt3 ON mt3.type_id=mt2.parent_id + LEFT JOIN ma_type mt4 ON mt4.type_id=mt3.parent_id + WHERE +# bai.company_id=#{companyId} +# and + tt.task_status>='38' + GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml index 4f761b5b..da070ef8 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseApplyDetailsMapper.xml @@ -48,7 +48,7 @@ remark, company_id) values (#{parenntId,jdbcType=INTEGER}, #{typeId,jdbcType=INTEGER}, #{preNum,jdbcType=FLOAT}, #{alNum,jdbcType=FLOAT}, #{status,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, - #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, + NOW(), #{updateBy,jdbcType=VARCHAR}, NOW(), #{remark,jdbcType=VARCHAR}, #{companyId,jdbcType=INTEGER}) @@ -331,7 +331,7 @@ (#{item.parenntId,jdbcType=INTEGER}, #{item.typeId,jdbcType=INTEGER}, #{item.preNum,jdbcType=FLOAT}, #{item.alNum,jdbcType=FLOAT}, #{item.status,jdbcType=VARCHAR}, #{item.createBy,jdbcType=VARCHAR}, - #{item.createTime,jdbcType=TIMESTAMP}, #{item.updateBy,jdbcType=VARCHAR}, #{item.updateTime,jdbcType=TIMESTAMP}, + NOW(), #{item.updateBy,jdbcType=VARCHAR}, NOW(), #{item.remark,jdbcType=VARCHAR}, #{item.companyId,jdbcType=INTEGER}) diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml index 6662bc61..104d6509 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/TmTaskMapper.xml @@ -512,7 +512,7 @@ SELECT lad.*, mt.type_name AS typeModelName, mt1.type_name AS typeName,mt.unit_name as unitName, mt.manage_type as manageType, case WHEN mt.manage_type = '0' then '编号' else '计数' end manageTypeName, - mt.num + mt.num, (lad.pre_num - IF(lad.al_num IS NULL,'0',lad.al_num)) AS outNum FROM lease_apply_details lad LEFT JOIN ma_type mt ON lad.type_id = mt.type_id diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml index 7cf90029..445eeafc 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaMachineMapper.xml @@ -68,7 +68,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mps.prop_id = #{propId} - AND (m.ma_code like concat('%',#{keyWord},'%') or m.buy_task like concat('%',#{keyWord},'%')) + AND (m.ma_code like concat('%',#{keyWord},'%') or m.buy_task like concat('%',#{keyWord},'%') + or mt.type_name like concat('%',#{keyWord},'%') or mt1.type_name like concat('%',#{keyWord},'%') + or mt2.type_name like concat('%',#{keyWord},'%')) AND m.create_time between #{beginTime} and #{endTime} @@ -88,7 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt.parent_id = mt1.type_id left join ma_type mt2 on mt1.parent_id = mt2.type_id left join ma_label_bind mmb on m.ma_id = mmb.ma_id and m.type_id = mmb.type_id - where m.ma_code = #{maCode} + where m.ma_code = #{maCode} or m.qr_code = #{maCode} diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml index 50a70919..8f26a0f7 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/largeScreen/LargeScreenMapper.xml @@ -16,13 +16,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + insert into bm_qrcode_info