diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java index 20ab7c1b..bfb0168f 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/RemoteLogService.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.system.api; +import com.bonus.sgzb.system.api.domain.BmNumLogs; import com.bonus.sgzb.system.api.domain.SysOperLog; import com.bonus.sgzb.system.api.factory.RemoteLogFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -29,6 +30,17 @@ public interface RemoteLogService @PostMapping("/operlog") public R saveLog(@RequestBody SysOperLog sysOperLog, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception; + /** + * 保存物资记录日志 + * @param bmNumLogs 物资信息 + * @param source 请求来源 + * @return 结果 + * @throws Exception 异常信息 + */ + @PostMapping("/bm_num_logs") + public R saveNumberLog(@RequestBody BmNumLogs bmNumLogs, @RequestHeader(SecurityConstants.FROM_SOURCE) String source) throws Exception; + + /** * 保存访问记录 * diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java new file mode 100644 index 00000000..dd10acdd --- /dev/null +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/domain/BmNumLogs.java @@ -0,0 +1,85 @@ +package com.bonus.sgzb.system.api.domain; + +import java.time.LocalDateTime; + +import com.bonus.sgzb.common.core.annotation.Excel; +import com.bonus.sgzb.common.core.web.domain.BaseEntity; +import lombok.Getter; +import lombok.Setter; + +/** + * @author syruan + */ +@Getter +@Setter +public class BmNumLogs extends BaseEntity { + + private static final long serialVersionUID = 1L; + + /** + * ID + */ + @Excel(name = "ID") + private Integer id; + + /** + * 模块名称/title标题 + */ + @Excel(name = "模块名称/title标题") + private String modelTitle; + + /** + * 接口地址/请求方法 + */ + @Excel(name = "接口地址/请求方法") + private String method; + + /** + * 实例 + */ + @Excel(name = "实例/任务") + private String task; + + /** + * 规格id + */ + @Excel(name = "规格id") + private Integer typeId; + + /** + * 描述/请求参数/实体 + */ + @Excel(name = "描述/请求参数/实体") + private String description; + + /** + * 响应内容/状态码/返回参数 + */ + @Excel(name = "响应内容/状态码/返回参数") + private String jsonResult; + + /** + * 请求时间 + */ + @Excel(name = "请求时间") + private LocalDateTime time; + + /** + * 创建人 + */ + @Excel(name = "创建人") + private String creator; + + /** + * 备注 + */ + @Excel(name = "备注") + private String remark; + + /** + * 状态: 默认0, 其他值则为异常 + */ + @Excel(name = "状态") + private Byte status; + +} \ No newline at end of file diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java index 19045eef..f25abcec 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/system/api/factory/RemoteLogFallbackFactory.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.system.api.factory; +import com.bonus.sgzb.system.api.domain.BmNumLogs; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.cloud.openfeign.FallbackFactory; @@ -31,6 +32,11 @@ public class RemoteLogFallbackFactory implements FallbackFactory saveNumberLog(BmNumLogs bmNumLogs, String source) throws Exception { + return R.fail("保存物资库存日志失败:" + throwable.getMessage()); + } + @Override public R saveLogininfor(SysLogininfor sysLogininfor, String source) { diff --git a/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java b/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java index 516d7fc1..644a0d17 100644 --- a/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java +++ b/sgzb-auth/src/main/java/com/bonus/sgzb/auth/controller/TokenController.java @@ -33,6 +33,7 @@ import java.util.Map; @RestController @Slf4j public class TokenController { + @Autowired private TokenService tokenService; diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java index 1de94e0a..2a3bcae2 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/BackApplyController.java @@ -260,6 +260,10 @@ public class BackApplyController extends BaseController { @PostMapping("examineList") public AjaxResult examineList(@RequestBody BackApplyInfo record) { try { + if (StringUtils.isNull(record)) { + return AjaxResult.error("参数错误"); + } + List list = backApplyService.examineList(record); return success(list); } catch (Exception e) { 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 index 0190c742..44b32793 100644 --- 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 @@ -123,7 +123,6 @@ public class BackReceiveController extends BaseController { * 编码退料--管理方式为0的 * * @param record 查询条件 - * * @return AjaxResult对象 */ @Log(title = "退料接收-编码退料", businessType = BusinessType.INSERT) @@ -143,6 +142,22 @@ public class BackReceiveController extends BaseController { } } + /** + * 退料接收撤回 + * + * @return AjaxResult对象 + */ + @Log(title = "退料接收撤回") + @PostMapping("revoke") + public AjaxResult revoke(@RequestBody BackApplyInfo record) { + int res = backReceiveService.revoke(record); + if (res > 0) { + return AjaxResult.success("撤回成功"); + } else { + return AjaxResult.error("撤回失败"); + } + } + /** * 退料接收-rfid退料 * 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 index 3856fff4..7fd88b53 100644 --- 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 @@ -190,4 +190,8 @@ public interface BackReceiveMapper { List getBackMachine(TmTask task); List getRecord(TmTask task); + + int deleteCheckDetails(BackApplyInfo backApplyInfo); + + List getMaId(BackApplyInfo backApplyInfo); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/TmTaskMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/TmTaskMapper.java index e1adac82..d1f1b0ce 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/TmTaskMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/TmTaskMapper.java @@ -114,4 +114,6 @@ public interface TmTaskMapper { List getLeaseOutListByUser(TmTask task); List getLeaseDetailByParentId(TmTask record); + + List getMaTypeDetails(List leaseApplyDetails); } \ 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 index adeeef75..10e057b7 100644 --- 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 @@ -93,4 +93,6 @@ public interface BackReceiveService { List getBackMachine(TmTask task); List getRecord(TmTask task); + + int revoke(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 index ac680056..514d5965 100644 --- 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 @@ -261,6 +261,16 @@ public class BackReceiveServiceImpl implements BackReceiveService { return backReceiveMapper.getRecord(task); } + @Override + public int revoke(BackApplyInfo record) { + //删除back_check_details + int res = deleteBcd(record); + if (res == 0) { + throw new RuntimeException("删除back_check_details异常"); + } + return res; + } + private int insertRad(int taskId, List wxList) { int result = 0; if (wxList != null) { @@ -378,6 +388,23 @@ public class BackReceiveServiceImpl implements BackReceiveService { return res; } + private int deleteBcd(BackApplyInfo record) { + int res = 0; + if (record != null) { + String manageType = record.getManageType(); + if ("0".equals(manageType)) { + List maId = backReceiveMapper.getMaId(record); + for (Integer s : maId) { + //机具状态变为在用 + backReceiveMapper.updateMaStatus(s, "16"); + } + } + res = backReceiveMapper.deleteCheckDetails(record); + } + + return res; + } + /** * 编号生成规则 diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java index 20909c46..b0c0a4df 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/TmTaskServiceImpl.java @@ -491,6 +491,12 @@ public class TmTaskServiceImpl implements TmTaskService { for (TmTask tmTask : tmTaskList) { int count = 0; if (tmTask != null) { + if (tmTask.getTaskStatus() == 31) { + tmTask.setTaskName("机具分公司审核"); + } + if (tmTask.getTaskStatus() == 32) { + tmTask.setTaskName("施工部审核"); + } // 去查询任务分单表 List collect = tmTaskMapper.getAuditManageListByLeaseInfo(tmTask); // 对领料任务集合查询具体详情 @@ -525,6 +531,12 @@ public class TmTaskServiceImpl implements TmTaskService { List tmTaskList = new ArrayList<>(); TmTask tmTask = tmTaskMapper.getLeaseListTmTask(task); if (tmTask != null) { + if (tmTask.getTaskStatus() == 31) { + tmTask.setTaskName("机具分公司审核"); + } + if (tmTask.getTaskStatus() == 32) { + tmTask.setTaskName("施工部审核"); + } List leaseApplyInfoList = tmTaskMapper.getLeaseListByLeaseInfo(task); tmTask.setLeaseApplyInfoList(leaseApplyInfoList); @@ -534,6 +546,7 @@ public class TmTaskServiceImpl implements TmTaskService { // 去查询领料任务详情表 List leaseApplyDetails = tmTaskMapper.getLeaseApplyDetailsCq(leaseApplyInfo); if (leaseApplyDetails != null && !leaseApplyDetails.isEmpty()) { +// tmTaskMapper.getMaTypeDetails(leaseApplyDetails); listLeaseDetails.addAll(leaseApplyDetails); } } diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml index c339635e..d6289d6d 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/BackReceiveMapper.xml @@ -578,6 +578,12 @@ status = '1' where id = #{info.id} + + delete from back_check_details where parent_id = #{parentId} and type_id = #{typeId} + + and ma_id = #{maId} + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml index 5a9b8d45..a92c6c29 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/app/LeaseOutDetailsMapper.xml @@ -281,7 +281,7 @@ UPDATE ma_machine SET - ma_status = '16' , create_time = NOW() + ma_status = '16',create_time = NOW() type_id = #{record.typeId} 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 efc7f17d..48d3908a 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 @@ -967,4 +967,10 @@ and lad.type_id = #{typeId} + diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java new file mode 100644 index 00000000..c6dc4e47 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BmNumLogsController.java @@ -0,0 +1,54 @@ +package com.bonus.sgzb.material.controller; +import com.bonus.sgzb.common.core.web.controller.BaseController; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.core.web.page.TableDataInfo; +import com.bonus.sgzb.common.security.annotation.InnerAuth; +import com.bonus.sgzb.system.api.domain.BmNumLogs; +import com.bonus.sgzb.material.service.impl.BmNumLogsService; +import org.springframework.web.bind.annotation.*; + +import org.springframework.beans.factory.annotation.Autowired; + +import java.util.List; + +/** +* (bm_num_logs)表控制层 +* +* @author syruan +*/ +@RestController +@RequestMapping("/bm_num_logs") +public class BmNumLogsController extends BaseController { + + /** + * 服务对象 + */ + @Autowired + private BmNumLogsService bmNumLogsService; + + @GetMapping("/list") + public TableDataInfo list() { + startPage(); + List list = bmNumLogsService.selectAll(); + return getDataTable(list); + } + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("selectByPrimaryKey") + public BmNumLogs selectByPrimaryKey(Integer id) { + return bmNumLogsService.selectByPrimaryKey(id); + } + + @InnerAuth + @PostMapping + public AjaxResult add(@RequestBody BmNumLogs bmNumLogs) { + return toAjax(bmNumLogsService.insert(bmNumLogs)); + } + + +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java index 5003db01..433035f4 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/SltAgreementInfoController.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import java.util.ArrayList; import java.util.List; @@ -31,8 +32,8 @@ import java.util.List; @RestController @RequestMapping("/sltAgreementInfo") public class SltAgreementInfoController extends BaseController { - @Autowired - private SltAgreementInfoService service; + @Resource + private SltAgreementInfoService sltAgreementInfoService; /** * 根据条件获取协议结算列表 @@ -42,11 +43,16 @@ public class SltAgreementInfoController extends BaseController { public TableDataInfo getSltAgreementInfo(AgreementInfo bean) { startPage(); List list = new ArrayList<>(); + //逻辑需要确认,当往来单位id,工程标段ID,结算状态为空时是否返回异常,如果返回异常前端配合改造 if (bean.getUnitId() == null && bean.getProjectId() == null && bean.getSltStatus()== null){ }else { - list = service.getSltAgreementInfo(bean); + list = sltAgreementInfoService.getSltAgreementInfo(bean); } + //上面代码可以改造为 + /*if(bean.getUnitId() != null || bean.getProjectId() != null || bean.getSltStatus()!= null){ + list = sltAgreementInfoService.getSltAgreementInfo(bean); + }*/ return getDataTable(list); } @@ -56,7 +62,7 @@ public class SltAgreementInfoController extends BaseController { @ApiOperation(value = "根据协议获取结算清单") @PostMapping("/getSltInfo") public AjaxResult getSltInfo(@RequestBody List list) { - SltInfoVo bean = service.getSltInfo(list); + SltInfoVo bean = sltAgreementInfoService.getSltInfo(list); return AjaxResult.success(bean); } @@ -67,7 +73,7 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/exportLease") public void exportLease(HttpServletResponse response,@RequestBody List list) { - List explist = service.getLeaseList(list); + List explist = sltAgreementInfoService.getLeaseList(list); List leaseInfoList = Convert.toList(LeaseInfo.class,explist); ExcelUtil util = new ExcelUtil(LeaseInfo.class); util.exportExcel(response, leaseInfoList, "租赁明细导出"); @@ -80,7 +86,7 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/exportLose") public void exportLose(HttpServletResponse response,@RequestBody List list) { - List explist = service.getLoseList(list); + List explist = sltAgreementInfoService.getLoseList(list); List leaseInfoList = Convert.toList(LoseInfo.class,explist); ExcelUtil util = new ExcelUtil(LoseInfo.class); util.exportExcel(response, leaseInfoList, "丢失明细导出"); @@ -93,7 +99,7 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/exportRepair") public void exportRepair(HttpServletResponse response,@RequestBody List list) { - List explist = service.getRepairList(list); + List explist = sltAgreementInfoService.getRepairList(list); List leaseInfoList = Convert.toList(LeaseInfo.class,explist); ExcelUtil util = new ExcelUtil(LeaseInfo.class); util.exportExcel(response, leaseInfoList, "维修明细导出"); @@ -106,7 +112,7 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/exportScrap") public void exportScrap(HttpServletResponse response,@RequestBody List list) { - List explist = service.getScrapList(list); + List explist = sltAgreementInfoService.getScrapList(list); List leaseInfoList = Convert.toList(ScrapInfo.class,explist); ExcelUtil util = new ExcelUtil(ScrapInfo.class); util.exportExcel(response, leaseInfoList, "维修明细导出"); @@ -119,7 +125,7 @@ public class SltAgreementInfoController extends BaseController { @PostMapping("/submitFee") public AjaxResult submitFee(@RequestBody SltAgreementApply apply) { - return service.submitFee(apply); + return sltAgreementInfoService.submitFee(apply); } /** @@ -130,7 +136,7 @@ public class SltAgreementInfoController extends BaseController { public TableDataInfo getSltExam(AgreementInfo bean) { startPage(); - List list = service.getSltExam(bean); + List list = sltAgreementInfoService.getSltExam(bean); return getDataTable(list); } @@ -141,7 +147,7 @@ public class SltAgreementInfoController extends BaseController { @GetMapping("/getSltExamInfo") public AjaxResult getSltExamInfo(SltAgreementApply apply) { - SltInfoVo bean = service.getSltExamInfo(apply); + SltInfoVo bean = sltAgreementInfoService.getSltExamInfo(apply); return AjaxResult.success(bean); } @@ -152,7 +158,7 @@ public class SltAgreementInfoController extends BaseController { @GetMapping("/settlementReview") public AjaxResult settlementReview(SltAgreementApply apply) { - return toAjax(service.settlementReview(apply)); + return toAjax(sltAgreementInfoService.settlementReview(apply)); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanManagementVO.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanManagementVO.java index 4533ac26..22305a61 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanManagementVO.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanManagementVO.java @@ -55,12 +55,12 @@ public class PlanManagementVO { /** 借出方原计划数 */ @Excel(name = "原计划数") @ApiModelProperty(value = "借出方原计划数") - private String borrowerOrigPlanNum; + private Double borrowerOrigPlanNum; /** 借出方现计划数 */ @Excel(name = "现计划数") @ApiModelProperty(value = "借出方现计划数") - private String borrowerNowPlanNum; + private Double borrowerNowPlanNum; /** 借入方单位 */ @Excel(name = "借入方单位") @@ -69,25 +69,25 @@ public class PlanManagementVO { /** 借入方原计划数 */ @ApiModelProperty(value = "借入方原计划数") - private String lenderOrigPlanNum; + private Double lenderOrigPlanNum; /** 借入方现计划数 */ @Excel(name = "现有计划数") @ApiModelProperty(value = "借入方现计划数") - private String lenderNowPlanNum; + private Double lenderNowPlanNum; /** 借出数 */ @Excel(name = "借调数量") @ApiModelProperty(value = "借出数") - private String borrowNum; + private Double borrowNum; /** 计划单价 */ @ApiModelProperty(value = "计划单价") - private String planPrice; + private Double planPrice; /** 计划总价 */ @ApiModelProperty(value = "计划总价") - private String planCost; + private Double planCost; /** 类型id */ @ApiModelProperty(value = "类型id") diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanVO.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanVO.java index 58e2f003..6301fe39 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanVO.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PlanVO.java @@ -47,17 +47,17 @@ public class PlanVO { /** 计划数 */ @Excel(name = "计划数") @ApiModelProperty(value = "计划数") - private String lenderOrigPlanNum; + private Double lenderOrigPlanNum; /** 计划单价 */ @Excel(name = "计划单价") @ApiModelProperty(value = "计划单价") - private String planPrice; + private Double planPrice; /** 计划总价 */ @Excel(name = "计划总价") @ApiModelProperty(value = "计划总价") - private String planCost; + private Double planCost; /** 类型id */ @ApiModelProperty(value = "类型id") @@ -77,6 +77,10 @@ public class PlanVO { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; + /** 借出数 */ + @ApiModelProperty(value = "借出数") + private Double borrowNum; + /** 备注 */ @Excel(name = "备注") @ApiModelProperty(value = "备注") diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java index b3720591..97bd6221 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BackApplyMapper.java @@ -133,4 +133,10 @@ public interface BackApplyMapper { List selectIdByTaskId(Integer taskId); int getUseNumByTypeId(String typeId); + + int getManageType(String typeId); + + int getLeaseOutNum(String typeId); + + int getbackCheckNum(String typeId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java new file mode 100644 index 00000000..ef417e9d --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/BmNumLogsMapper.java @@ -0,0 +1,23 @@ +package com.bonus.sgzb.material.mapper; + +import com.bonus.sgzb.system.api.domain.BmNumLogs; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +@Mapper +public interface BmNumLogsMapper { + int deleteByPrimaryKey(Integer id); + + int insert(BmNumLogs record); + + int insertSelective(BmNumLogs record); + + BmNumLogs selectByPrimaryKey(Integer id); + + List selectAll(); + + int updateByPrimaryKeySelective(BmNumLogs record); + + int updateByPrimaryKey(BmNumLogs record); +} \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java index 17871e9c..1fb4e9a3 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BackApplyServiceImpl.java @@ -375,7 +375,16 @@ public class BackApplyServiceImpl implements BackApplyService { @Override public int getUseNumByTypeId(String typeId) { - return backApplyMapper.getUseNumByTypeId(typeId); + int manageType = backApplyMapper.getManageType(typeId); + if (manageType == 0) { + // 编码入库的机具 + return backApplyMapper.getUseNumByTypeId(typeId); + } else { + // 数量入库的机具 + int leaseOutNum = backApplyMapper.getLeaseOutNum(typeId); + int backCheckNum = backApplyMapper.getbackCheckNum(typeId); + return leaseOutNum - backCheckNum; + } } } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java new file mode 100644 index 00000000..3b1044e8 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/BmNumLogsService.java @@ -0,0 +1,50 @@ +package com.bonus.sgzb.material.service.impl; + +import org.springframework.stereotype.Service; + +import org.springframework.beans.factory.annotation.Autowired; + +import com.bonus.sgzb.system.api.domain.BmNumLogs; +import com.bonus.sgzb.material.mapper.BmNumLogsMapper; + +import java.util.List; + +@Service +public class BmNumLogsService{ + + @Autowired + private BmNumLogsMapper bmNumLogsMapper; + + public int deleteByPrimaryKey(Integer id) { + return bmNumLogsMapper.deleteByPrimaryKey(id); + } + + + public int insert(BmNumLogs record) { + return bmNumLogsMapper.insert(record); + } + + public List selectAll() { + return bmNumLogsMapper.selectAll(); + } + + public int insertSelective(BmNumLogs record) { + return bmNumLogsMapper.insertSelective(record); + } + + + public BmNumLogs selectByPrimaryKey(Integer id) { + return bmNumLogsMapper.selectByPrimaryKey(id); + } + + + public int updateByPrimaryKeySelective(BmNumLogs record) { + return bmNumLogsMapper.updateByPrimaryKeySelective(record); + } + + + public int updateByPrimaryKey(BmNumLogs record) { + return bmNumLogsMapper.updateByPrimaryKey(record); + } + +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PlanManagementServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PlanManagementServiceImpl.java index 2314fedd..9fbd80d9 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PlanManagementServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PlanManagementServiceImpl.java @@ -14,8 +14,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.interceptor.TransactionAspectSupport; -import java.text.SimpleDateFormat; -import java.util.Date; import java.util.List; /** @@ -162,15 +160,9 @@ public class PlanManagementServiceImpl implements PlanManagementService { //新增plan_borrow_details for (CheckDetailsInfo checkDetailsInfo : dto.getCheckDetailsList()) { checkDetailsInfo.setPlanId(dto.getBorrowId()); - //checkDetailsInfo.setCreateTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); } res += planManagementMapper.insertPlanBorrowDetail(dto.getCheckDetailsList()); return res; } - public static void main(String[] args) { - SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); - System.out.println(simpleDateFormat.format(new Date())); - } - } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java index 0fe434e2..f2c31785 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseMacodeInfoServiceImpl.java @@ -336,39 +336,17 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService checkDetailsMapper.updatePurchaseCheckDetailsByTaskId(taskId, typeId); } } - //判断是否全部已操作(通过或不通过) int count=purchaseMacodeInfoMapper.isOperateAll(taskId); if (count<=0){ - //是否为全部不通过 - int count1 = purchaseMacodeInfoMapper.selectPurchaseCheckDetailsStatus(taskId); - if (count1>0){ - TmTask task = new TmTask(); - task.setTaskId(taskId); - task.setTaskStatus(28); - task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); - task.setUpdateTime(DateUtils.getNowDate()); - taskMapper.updateTmTask(task); - }else { - TmTask task = new TmTask(); - task.setTaskId(taskId); - task.setTaskStatus(107); - task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); - task.setUpdateTime(DateUtils.getNowDate()); - taskMapper.updateTmTask(task); - } + //全部审核任务状态改为已审核 + TmTask task = new TmTask(); + task.setTaskId(taskId); + task.setTaskStatus(28); + task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); + task.setUpdateTime(DateUtils.getNowDate()); + taskMapper.updateTmTask(task); } -// // 当全部审核的时候任务改为入库状态 -// Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId); -// if (count <= 0) { -// TmTask task = new TmTask(); -// task.setTaskId(taskId); -// task.setTaskStatus(28); -// task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); -// task.setUpdateTime(DateUtils.getNowDate()); -// taskMapper.updateTmTask(task); -// } - return 1; } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java index 0f976181..590aa2ec 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/SltAgreementInfoServiceImpl.java @@ -9,16 +9,14 @@ import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.AgreementInfo; -import com.bonus.sgzb.material.domain.RepairTaskDetails; -import com.bonus.sgzb.material.domain.ScrapApplyDetails; import com.bonus.sgzb.material.domain.TmTask; import com.bonus.sgzb.material.mapper.SltAgreementInfoMapper; import com.bonus.sgzb.material.service.SltAgreementInfoService; import com.bonus.sgzb.material.vo.GlobalContants; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import javax.annotation.Resource; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -31,20 +29,24 @@ import java.util.List; */ @Service public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { - @Autowired - private SltAgreementInfoMapper mapper; + @Resource + private SltAgreementInfoMapper sltAgreementInfoMapper; @Override - public List getSltAgreementInfo(AgreementInfo bean) { - return mapper.getSltAgreementInfo(bean); + public List getSltAgreementInfo(AgreementInfo bean) { + return sltAgreementInfoMapper.getSltAgreementInfo(bean); } @Override public SltInfoVo getSltInfo(List list) { SltInfoVo sltInfoVo = new SltInfoVo(); + //租赁费用列表 List leaseList = getLeaseList(list); + //维修费用列表 List repairList = getRepairList(list); + //报废费用列表 List scrapList = getScrapList(list); + //丢失费用列表 List loseList = getLoseList(list); sltInfoVo.setLeaseList(leaseList); sltInfoVo.setRepairList(repairList); @@ -59,8 +61,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public SltInfoVo getSltExamInfo(SltAgreementApply apply) { SltInfoVo sltInfoVo = new SltInfoVo(); List list = new ArrayList<>(); - String cost = mapper.getCost(apply); - List relations = mapper.getRelations(apply); + String cost = sltAgreementInfoMapper.getCost(apply); + List relations = sltAgreementInfoMapper.getRelations(apply); sltInfoVo.setRelations(relations); for (SltAgreementRelation relation : relations){ AgreementInfo info = new AgreementInfo(); @@ -84,10 +86,10 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public int settlementReview(SltAgreementApply apply) { Long userid = SecurityUtils.getLoginUser().getUserid(); apply.setAuditor(String.valueOf(userid)); - int i = mapper.updateRelation(apply); + int i = sltAgreementInfoMapper.updateRelation(apply); int j = 0; if (i > 0){ - List relations = mapper.getRelations(apply); + List relations = sltAgreementInfoMapper.getRelations(apply); List infos = new ArrayList<>(); for (SltAgreementRelation bean : relations){ AgreementInfo info = new AgreementInfo(); @@ -97,12 +99,13 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { List loseList = getLoseList(infos); for (SltAgreementInfo agreementInfo : loseList){ if (agreementInfo.getMaId() != null && agreementInfo.getMaId().isEmpty()){ - mapper.updateMaStatus(agreementInfo); + sltAgreementInfoMapper.updateMaStatus(agreementInfo); } } - j = mapper.updateApply(apply); + j = sltAgreementInfoMapper.updateApply(apply); }else { throw new ServiceException("结算审核失败"); + //throw new ServiceException(ExceptionDict.SETTLEMENT_REVIEW_ERROR_MSG,ExceptionDict.SETTLEMENT_REVIEW_ERROR); } return j; } @@ -111,10 +114,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { List relations = new ArrayList<>(); for (AgreementInfo info : list){ SltAgreementRelation relation = new SltAgreementRelation(); - BigDecimal loseCost = new BigDecimal("0"); + /*BigDecimal loseCost = new BigDecimal("0"); BigDecimal leaseCost = new BigDecimal("0"); BigDecimal scrapCost = new BigDecimal("0"); - BigDecimal repairCost = new BigDecimal("0"); + BigDecimal repairCost = new BigDecimal("0");*/ + BigDecimal loseCost = BigDecimal.ZERO; + BigDecimal leaseCost = BigDecimal.ZERO; + BigDecimal scrapCost = BigDecimal.ZERO; + BigDecimal repairCost = BigDecimal.ZERO; for (SltAgreementInfo lease : leaseList){ if (lease.getAgreementId().equals(info.getAgreementId().toString())){ relation.setAgreementId(lease.getAgreementId()); @@ -139,6 +146,7 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { } for (SltAgreementInfo lose : loseList){ if (lose.getAgreementId().equals(info.getAgreementId().toString())){ + //TODO 上面已经set过值,这里为什么还要set值 relation.setAgreementId(lose.getAgreementId()); relation.setProjectName(lose.getProjectName()); relation.setUnitName(lose.getUnitName()); @@ -166,17 +174,18 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { apply.setCreator(String.valueOf(userid)); apply.setCode(code); apply.setCompanyId(relations.get(0).getCompanyId()); - int i = mapper.insApply(apply); + int i = sltAgreementInfoMapper.insApply(apply); if (i > 0){ for (SltAgreementRelation relation : relations){ AgreementInfo info = new AgreementInfo(); info.setAgreementId(Long.valueOf(relation.getAgreementId())); list.add(info); relation.setApplyId(String.valueOf(apply.getId())); - mapper.updateInfoStatus(relation.getAgreementId()); - int j = mapper.insRelation(relation); + sltAgreementInfoMapper.updateInfoStatus(relation.getAgreementId()); + int j = sltAgreementInfoMapper.insRelation(relation); if (j < 0){ throw new ServiceException("新增协议结算记录失败"); + //throw new ServiceException(ExceptionDict.NEW_AGREEMENT_SETTLEMENT_ERROR_MSG,ExceptionDict.NEW_AGREEMENT_SETTLEMENT_ERROR); } } List leaseList = getLeaseList(list); @@ -185,45 +194,57 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { List loseList = getLoseList(list); for (SltAgreementInfo info : leaseList){ info.setSltType("1"); + //info.setSltType(CostTypeEnum.LEASE_COST.getCode()); info.setApplyId(String.valueOf(apply.getId())); info.setPartType("1"); - mapper.insDetails(info); + //info.setPartType(PartTypeEnum.CHARGE.getCode()); + sltAgreementInfoMapper.insDetails(info); } for (SltAgreementInfo info : repairList){ info.setSltType("3"); + //info.setSltType(CostTypeEnum.MAINTENANCE_COST.getCode()); info.setApplyId(String.valueOf(apply.getId())); - mapper.insDetails(info); + //对是否收费进行转换 + //info.setPartType(PartTypeEnum.getCodeByInfo(info.getPartType())); + info.setPartType(info.getPartType()=="不收费" ? "0" : "1"); + sltAgreementInfoMapper.insDetails(info); } for (SltAgreementInfo info : scrapList){ info.setSltType("4"); + //info.setSltType(CostTypeEnum.SCRAP_COST.getCode()); info.setApplyId(String.valueOf(apply.getId())); - info.setPartType(info.getScrapType()); - mapper.insDetails(info); + //info.setPartType(info.getScrapType()); + //info.setPartType(ScrapTypeEnum.getCodeByInfo(info.getScrapType())); + info.setPartType(info.getScrapType()=="自然" ? "0" : "1"); + sltAgreementInfoMapper.insDetails(info); } for (SltAgreementInfo info : loseList){ info.setSltType("2"); + //info.setSltType(CostTypeEnum.LOSE_COST.getCode()); info.setApplyId(String.valueOf(apply.getId())); - info.setPartType("1"); - mapper.insDetails(info); + info.setPartType("1"); + //info.setPartType(PartTypeEnum.CHARGE.getCode()); + sltAgreementInfoMapper.insDetails(info); } }else { throw new ServiceException("新增结算单号失败"); + //throw new ServiceException(ExceptionDict.NEW_SETTLEMENT_NUMBER_ERROR_MSG,ExceptionDict.NEW_SETTLEMENT_NUMBER_ERROR); } return AjaxResult.success(); } @Override public List getSltExam(AgreementInfo bean) { - return mapper.getSltExam(bean); + return sltAgreementInfoMapper.getSltExam(bean); } public List getLoseList(List list) { List loseList = new ArrayList<>(); for (AgreementInfo bean : list){ - List oneOflist = mapper.getLoseList(bean); - loseList.addAll(oneOflist); + List oneOfList = sltAgreementInfoMapper.getLoseList(bean); + loseList.addAll(oneOfList); } for (SltAgreementInfo bean : loseList){ if (bean.getBuyPrice() == null){ @@ -235,7 +256,14 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice()); BigDecimal num = new BigDecimal(bean.getNum()); BigDecimal costs = buyPrice.multiply(num); - bean.setCosts(String.valueOf(costs)); + //计算租赁费用 + /* BigDecimal costs = BigDecimal.ZERO; + if (bean.getBuyPrice() != null && bean.getNum() != null){ + BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice()); + BigDecimal num = new BigDecimal(bean.getNum()); + costs = buyPrice.multiply(num); + } + bean.setCosts(String.valueOf(costs));*/ } return loseList; } @@ -243,15 +271,17 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public List getScrapList(List list) { List scrapList = new ArrayList<>(); String taskType = "57"; + //String taskType = TaskTypeEnum.SCRAP_TASK.getCode(); for (AgreementInfo bean : list){ - List taskList = mapper.getTaskList(bean,taskType); + List taskList = sltAgreementInfoMapper.getTaskList(bean,taskType); if (taskList != null && taskList.size() > 0){ - List scrapDetailsList = mapper.getScrapDetailsList(taskList); + List scrapDetailsList = sltAgreementInfoMapper.getScrapDetailsList(taskList); scrapList.addAll(scrapDetailsList); } } if (scrapList != null && scrapList.size() > 0){ for (SltAgreementInfo bean : scrapList){ + if (bean.getBuyPrice() == null){ bean.setBuyPrice("0"); } @@ -261,6 +291,13 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice()); BigDecimal num = new BigDecimal(bean.getNum()); BigDecimal costs = buyPrice.multiply(num); + //计算总金额 + /*BigDecimal costs = BigDecimal.ZERO; + if (bean.getBuyPrice() != null && bean.getBuyPrice() != null){ + BigDecimal buyPrice = new BigDecimal(bean.getBuyPrice()); + BigDecimal num = new BigDecimal(bean.getNum()); + costs = buyPrice.multiply(num); + }*/ bean.setCosts(String.valueOf(costs)); } } @@ -271,10 +308,11 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public List getRepairList(List list) { List repairList = new ArrayList<>(); String taskType = "41"; + //String taskType = TaskTypeEnum.MAINTENANCE_TASK.getCode(); for (AgreementInfo bean : list){ - List taskList = mapper.getTaskList(bean,taskType); + List taskList = sltAgreementInfoMapper.getTaskList(bean,taskType); if (taskList != null && taskList.size() > 0){ - List repairDetailsList = mapper.getRepairDetailsList(taskList); + List repairDetailsList = sltAgreementInfoMapper.getRepairDetailsList(taskList); repairList.addAll(repairDetailsList); } } @@ -284,8 +322,8 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { public List getLeaseList(List list) { List leaseList = new ArrayList<>(); for (AgreementInfo bean : list){ - List oneOflist = mapper.getLeaseList(bean); - leaseList.addAll(oneOflist); + List oneOfList = sltAgreementInfoMapper.getLeaseList(bean); + leaseList.addAll(oneOfList); } for (SltAgreementInfo bean : leaseList){ if (bean.getLeasePrice() == null){ @@ -302,6 +340,15 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); BigDecimal costs = leasePrice.multiply(num).multiply(leaseDays); bean.setCosts(String.valueOf(costs)); + /* BigDecimal costs = BigDecimal.ZERO; + //当单价,数量,租赁天数都不为空时计算总价 + if(bean.getLeasePrice() != null && bean.getNum() != null && bean.getLeaseDays() != null){ + BigDecimal leasePrice = new BigDecimal(bean.getLeasePrice()); + BigDecimal num = new BigDecimal(bean.getNum()); + BigDecimal leaseDays = new BigDecimal(bean.getLeaseDays()); + costs = leasePrice.multiply(num).multiply(leaseDays); + } + bean.setCosts(String.valueOf(costs));*/ } return leaseList; } @@ -311,7 +358,9 @@ public class SltAgreementInfoServiceImpl implements SltAgreementInfoService { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); Date nowDate = DateUtils.getNowDate(); String format = dateFormat.format(nowDate); - int taskNum = mapper.selectNumByDate(nowDate) + 1; + //String format = DateUtils.dateTime(); + //为什么要加1?是为了防止结果为0? + int taskNum = sltAgreementInfoMapper.selectNumByDate(nowDate) + 1; String codeNum = ""; if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) { codeNum = code + format + "-00" + taskNum; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/WorkSiteDirectManageImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/WorkSiteDirectManageImpl.java index 75de7c13..e3557fe7 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/WorkSiteDirectManageImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/WorkSiteDirectManageImpl.java @@ -413,7 +413,7 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService { BackApplyInfo backCheckDetails = new BackApplyInfo(); for (BackApplyInfo backApplyInfo2 : backApplyInfoList) { if (backApplyInfo1.getCompanyId().equals(backApplyInfo2.getCompanyId())) { - backCheckDetails.setParentId(backApplyInfo1.getId().intValue()); + backCheckDetails.setParentId(backApplyInfo2.getId().intValue()); backCheckDetails.setTypeId(backApplyInfo1.getTypeId()); backCheckDetails.setMaId(backApplyInfo1.getMaId()); backCheckDetails.setCreateBy(SecurityUtils.getLoginUser().getUserid().toString()); diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml index 15d52c20..f6052927 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BackApplyMapper.xml @@ -516,6 +516,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" mt.type_name typeCode, mt2.type_name AS typeName, bagi.agreement_code as agreementCode, + bad.pre_num AS preNum, bad.audit_num AS num FROM back_apply_details bad @@ -814,5 +815,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml new file mode 100644 index 00000000..f85c75fc --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/BmNumLogsMapper.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + id, model_title, `method`, task, type_id, description, json_result, `time`, creator, + remark, status + + + + + + + + + + delete from bm_num_logs + where id = #{id,jdbcType=INTEGER} + + + + + insert into bm_num_logs (model_title, `method`, task, + type_id, description, json_result, + `time`, creator, remark + ) + values (#{modelTitle,jdbcType=VARCHAR}, #{method,jdbcType=VARCHAR}, #{task,jdbcType=VARCHAR}, + #{typeId,jdbcType=INTEGER}, #{description,jdbcType=VARCHAR}, #{jsonResult,jdbcType=VARCHAR}, + #{time,jdbcType=TIMESTAMP}, #{creator,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR} + ) + + + + + insert into bm_num_logs + + + model_title, + + + `method`, + + + task, + + + type_id, + + + description, + + + json_result, + + + `time`, + + + creator, + + + remark, + + + + + #{modelTitle,jdbcType=VARCHAR}, + + + #{method,jdbcType=VARCHAR}, + + + #{task,jdbcType=VARCHAR}, + + + #{typeId,jdbcType=INTEGER}, + + + #{description,jdbcType=VARCHAR}, + + + #{jsonResult,jdbcType=VARCHAR}, + + + #{time,jdbcType=TIMESTAMP}, + + + #{creator,jdbcType=VARCHAR}, + + + #{remark,jdbcType=VARCHAR}, + + + + + + + update bm_num_logs + + + model_title = #{modelTitle,jdbcType=VARCHAR}, + + + `method` = #{method,jdbcType=VARCHAR}, + + + task = #{task,jdbcType=VARCHAR}, + + + type_id = #{typeId,jdbcType=INTEGER}, + + + description = #{description,jdbcType=VARCHAR}, + + + json_result = #{jsonResult,jdbcType=VARCHAR}, + + + `time` = #{time,jdbcType=TIMESTAMP}, + + + creator = #{creator,jdbcType=VARCHAR}, + + + remark = #{remark,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + + + update bm_num_logs + set model_title = #{modelTitle,jdbcType=VARCHAR}, + `method` = #{method,jdbcType=VARCHAR}, + task = #{task,jdbcType=VARCHAR}, + type_id = #{typeId,jdbcType=INTEGER}, + description = #{description,jdbcType=VARCHAR}, + json_result = #{jsonResult,jdbcType=VARCHAR}, + `time` = #{time,jdbcType=TIMESTAMP}, + creator = #{creator,jdbcType=VARCHAR}, + remark = #{remark,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml index 95caa111..82af489c 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml @@ -227,11 +227,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_supplier_info msi on pcd.supplier_id = msi.supplier_id left join tm_task tk on pcd.task_id = tk.task_id where 1=1 - and pcd.status !=3 - AND ( - (pcd.bind_num IS NULL OR pcd.bind_num = 0) AND pcd.STATUS != 5 - OR (pcd.bind_num IS NOT NULL AND pcd.bind_num != 0) - ) + and pcd.check_result='通过' +-- and pcd.status !=3 +-- AND ( +-- (pcd.bind_num IS NULL OR pcd.bind_num = 0) AND pcd.STATUS != 5 +-- OR (pcd.bind_num IS NOT NULL AND pcd.bind_num != 0) +-- ) and pcd.task_id = #{taskId} and (mt.type_name like concat('%',#{keyWord},'%') or mt1.type_name like concat('%',#{keyWord}) or msi.supplier like concat('%',#{keyWord})) diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml index 1bf7e402..2ab763d8 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml @@ -319,10 +319,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) t GROUP BY task_id + + + + + + + +