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 3e7fe13c..c0e89232 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 @@ -95,7 +95,7 @@ public class LeaseApplyDetails implements Serializable { /** * 更新时间 */ - @ApiModelProperty(value = "更新时间") + @ApiModelProperty(value = "更新时间 ") @DateTimeFormat(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/MaMachine.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java index 05d938ef..af2927ab 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaMachine.java @@ -4,8 +4,10 @@ package com.bonus.sgzb.base.api.domain; import com.bonus.sgzb.common.core.web.domain.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; @ApiModel(value="com.bonus.sgzb.base.api.domain.MaMachine") +@Data public class MaMachine extends BaseEntity { /** * 机具ID @@ -149,9 +151,7 @@ public class MaMachine extends BaseEntity { private String labelCode; - public long getMaId() { - return maId; - } + public void setMaId(long maId) { this.maId = maId; diff --git a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java index ceebe3ac..51a1f848 100644 --- a/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java +++ b/sgzb-api/sgzb-api-system/src/main/java/com/bonus/sgzb/base/api/domain/MaType.java @@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import java.math.BigDecimal; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -44,7 +45,7 @@ public class MaType extends BaseEntity { /** 实时库存 */ @ApiModelProperty(value = "实时库存") - private String num; + private BigDecimal num; /** 计量单位id */ @ApiModelProperty(value = "计量单位id") @@ -215,11 +216,11 @@ public class MaType extends BaseEntity { this.status = status; } - public String getNum() { + public BigDecimal getNum() { return num; } - public void setNum(String num) { + public void setNum(BigDecimal num) { this.num = num; } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java index 5f96bfd7..6fffcb5d 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/controller/TmTaskController.java @@ -275,14 +275,41 @@ public class TmTaskController extends BaseController { try { int taskResult = tmTaskService.updateByPrimaryKeySelective(task); if (taskResult > 0) { - if (CollUtil.isNotEmpty(task.getLeaseApplyDetails())) { - for (LeaseApplyDetails leaseApplyDetails : task.getLeaseApplyDetails()) { - leaseApplyDetailsService.updateByPrimaryKeySelective(leaseApplyDetails); - } - return AjaxResult.success("修改成功"); - } else { - return AjaxResult.error("任务表修改成功,但领料任务明细修改信息为空"); + if (CollUtil.isEmpty(task.getLeaseApplyInfoList())){ + return AjaxResult.error("任务表修改完成,但领料任务明细为空,执行失败!"); } + + // 根据参数判断是否需要修改工程与往来单位 + if (StringUtils.isNotNull(task.getProjectId()) && StringUtils.isNotNull(task.getUnitId())) { + Integer agreementId = tmTaskService.getAgreementIdByUnit(task); + if (StringUtils.isNotNull(agreementId)) { + task.setAgreementId(agreementId); + tmTaskService.updateAgreementByTask(task); // 修改任务关联的协议 + } + } + + for (LeaseApplyInfo leaseApplyInfo : task.getLeaseApplyInfoList()) { + if (leaseApplyInfo == null || leaseApplyInfo.getId() == null) { + continue; + } + if (StringUtils.isEmpty(leaseApplyInfo.getLeaseApplyDetails())) { + continue; + } + // 先删除之前的领料明细 + tmTaskService.deleteDetailsByParentId(String.valueOf(leaseApplyInfo.getId())); + // 删除后,插入新地领料任务明细 + if (StringUtils.isNotNull(leaseApplyInfo.getId())) { + for (LeaseApplyDetails leaseApplyDetails : leaseApplyInfo.getLeaseApplyDetails()) { + leaseApplyDetails.setParenntId(leaseApplyInfo.getId()); // 设置领料任务ID + } + // 插入领料任务明细 + boolean addLeaseTaskDetailsResult = leaseApplyDetailsService.batchInsert(leaseApplyInfo.getLeaseApplyDetails()) > 0; + System.out.println(addLeaseTaskDetailsResult ? "领料任务明细插入成功" : "领料任务明细插入失败"); + } else { + return AjaxResult.error("领料任务ID为空,修改失败!"); + } + } + return AjaxResult.success("修改成功"); } else { return AjaxResult.error("任务表修改失败"); } 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 6c6e55c3..57bcff3d 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 @@ -86,4 +86,8 @@ public class BackApplyInfo { private String lotId; private String unitId; private String backTime; + /** + * 机具管理方式 + */ + private String manageType; } diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java index 22ca6cef..a6de5e4b 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/mapper/LeaseApplyDetailsMapper.java @@ -17,6 +17,8 @@ import java.util.List; public interface LeaseApplyDetailsMapper { int deleteByPrimaryKey(Integer id); + int deleteByParentId(String parentId); + int insert(LeaseApplyDetails record); int insertOrUpdate(LeaseApplyDetails record); 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 999288fa..c5f029ad 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 @@ -45,6 +45,8 @@ public interface TmTaskMapper { int deleteDetailsByTaskId(@Param("id") String id); + int deleteDetailsByParentId(String parentId); + int insert(TmTask record); int insertOrUpdate(TmTask record); @@ -74,9 +76,13 @@ public interface TmTaskMapper { int insertAgreement(TmTask record); + int updateAgreementByTask(TmTask record); + int selectNumByMonth(Date nowDate); TmTask getLeaseListTmTask(TmTask task); LeaseApplyInfo getLeaseListByLeaseInfo(TmTask task); + + Integer getAgreementIdByUnit(TmTask task); } \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/LeaseApplyDetailsService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/LeaseApplyDetailsService.java index 1ec9c91d..992297de 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/LeaseApplyDetailsService.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/LeaseApplyDetailsService.java @@ -1,7 +1,8 @@ package com.bonus.sgzb.app.service; -import java.util.List; import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; + +import java.util.List; /** * Description: * @Author 阮世耀 @@ -11,6 +12,7 @@ import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; public interface LeaseApplyDetailsService{ + int deleteByParentId(String parentId); int deleteByPrimaryKey(Integer id); diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/TmTaskService.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/TmTaskService.java index 1ce66d49..5447b5ae 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/TmTaskService.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/TmTaskService.java @@ -27,6 +27,8 @@ public interface TmTaskService{ int deleteDetailsByTaskId(@Param("id") String id); + int deleteDetailsByParentId(String parentId); + int createTask(TmTask record); int insertOrUpdate(TmTask record); @@ -39,6 +41,10 @@ public interface TmTaskService{ int updateByPrimaryKeySelective(TmTask record); + Integer getAgreementIdByUnit(TmTask task); + + int updateAgreementByTask(TmTask record); + int updateByPrimaryKey(TmTask record); int updateBatch(List list); diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseApplyDetailsServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseApplyDetailsServiceImpl.java index ac1ee305..94ecfbbe 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseApplyDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/app/service/impl/LeaseApplyDetailsServiceImpl.java @@ -1,11 +1,12 @@ package com.bonus.sgzb.app.service.impl; +import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper; +import com.bonus.sgzb.app.service.LeaseApplyDetailsService; +import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; import org.springframework.stereotype.Service; + import javax.annotation.Resource; import java.util.List; -import com.bonus.sgzb.app.mapper.LeaseApplyDetailsMapper; -import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; -import com.bonus.sgzb.app.service.LeaseApplyDetailsService; /** * Description: * @Author 阮世耀 @@ -24,6 +25,11 @@ public class LeaseApplyDetailsServiceImpl implements LeaseApplyDetailsService{ return leaseApplyDetailsMapper.deleteByPrimaryKey(id); } + @Override + public int deleteByParentId(String id) { + return leaseApplyDetailsMapper.deleteByParentId(id); + } + @Override public int insert(LeaseApplyDetails record) { return leaseApplyDetailsMapper.insert(record); 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 a31bb0c1..2c6953d8 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 @@ -150,6 +150,16 @@ public class TmTaskServiceImpl implements TmTaskService{ return tmTaskMapper.deleteDetailsByTaskId(id); } + /** + * 根据parentID删除详情表配置的设备 + * @param parentId 所属ID + * @return 结果 + */ + @Override + public int deleteDetailsByParentId(String parentId) { + return tmTaskMapper.deleteDetailsByParentId(parentId); + } + @Override public int createTask(TmTask record) { return tmTaskMapper.insert(record); @@ -180,6 +190,24 @@ public class TmTaskServiceImpl implements TmTaskService{ return tmTaskMapper.updateByPrimaryKeySelective(record); } + /** + * @param task 查询条件 + * @return 协议的id + */ + @Override + public Integer getAgreementIdByUnit(TmTask task) { + return tmTaskMapper.getAgreementIdByUnit(task); + } + + /** + * @param record 修改信息 + * @return 结果 + */ + @Override + public int updateAgreementByTask(TmTask record) { + return tmTaskMapper.updateAgreementByTask(record); + } + @Override public int updateByPrimaryKey(TmTask record) { return tmTaskMapper.updateByPrimaryKey(record); diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/RepairController.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/RepairController.java index eaf34708..a8a21f29 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/RepairController.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/controller/RepairController.java @@ -40,6 +40,18 @@ public class RepairController extends BaseController { return getDataTable(list); } + /** + * 获取维修任务列表 + */ + @ApiOperation(value = "获取维修任务列表") + @Log(title = "维修任务列表", businessType = BusinessType.QUERY) + @GetMapping("/getAppRepairTaskList") + public AjaxResult getAppRepairTaskList(RepairTask bean) + { + List list = service.getRepairTaskList(bean); + return AjaxResult.success(list); + } + /** * 获取维修任务机具列表 */ @@ -53,6 +65,18 @@ public class RepairController extends BaseController { return getDataTable(list); } + /** + * 获取维修任务机具列表 + */ + @ApiOperation(value = "获取维修任务机具列表") + @Log(title = "维修任务机具列表", businessType = BusinessType.QUERY) + @GetMapping("/getAppRepairMaTypeList") + public AjaxResult getAppRepairMaTypeList(RepairTaskDetails bean) + { + List list = service.getRepairMaTypeList(bean); + return AjaxResult.success(list); + } + /** * 新增维修记录 */ diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java index 1d1ff479..78477b80 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/mapper/MaLabelBindMapper.java @@ -1,6 +1,7 @@ package com.bonus.sgzb.base.mapper; import java.util.List; +import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.domain.MaLabelBind; import com.bonus.sgzb.base.vo.MaLabelBindVO; import org.apache.ibatis.annotations.Mapper; @@ -44,6 +45,14 @@ public interface MaLabelBindMapper * @return 结果 */ public int insertMaLabelBindS(MaLabelBindVO maLabelBindVO); + + /** + * 新增机具设备标签ma_label_bind + * + * @param maMachine 机具设备标签ma_label_bind + * @return 结果 + */ + public int insertMaLabel(MaMachine maMachine); /** * 查询机具设备ma_id * diff --git a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java index c4493f64..cbcebc3e 100644 --- a/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java +++ b/sgzb-modules/sgzb-base/src/main/java/com/bonus/sgzb/base/service/impl/MaLabelBindServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.base.service.impl; +import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.mapper.MaLabelBindMapper; import com.bonus.sgzb.base.service.IMaLabelBindService; import com.bonus.sgzb.base.vo.MaLabelBindVO; @@ -8,6 +9,7 @@ import lombok.extern.flogger.Flogger; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.List; /** @@ -58,7 +60,7 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService return maLabelBindMapper.selecthistoryList(maLabelBindVO); } /** - * 新增机具设备标签ma_label_bind + * 绑定机具设备标签ma_label_bind * * @param maLabelBind 机具设备标签ma_label_bind * @return 结果 @@ -69,15 +71,20 @@ public class MaLabelBindServiceImpl implements IMaLabelBindService int i = 0; int b =0; MaLabelBindVO bean = maLabelBindMapper.selectMaMachineMaId(maLabelBind.getMaCode()); - if(StringHelper.isNotEmpty(bean.getMaId())){ - maLabelBind.setMaId(bean.getMaId()); - maLabelBind.setTypeId(bean.getTypeId()); + if(null != bean){ + return b; + }else { + MaMachine maMachine =new MaMachine(); + maMachine.setMaCode(maLabelBind.getMaCode()); + maMachine.setTypeId(maLabelBind.getTypeId()); + maLabelBindMapper.insertMaLabel(maMachine); + maLabelBind.setMaId(String.valueOf(maMachine.getMaId())); maLabelBind.setStatus("1"); maLabelBind.setIsBind("1"); b=maLabelBindMapper.updateMaLabelBindMaIds(maLabelBind); i = maLabelBindMapper.insertMaLabelBindS(maLabelBind); - } - return i ; + } + return i; } /** 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 675fc9a5..4f761b5b 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 @@ -29,11 +29,17 @@ from lease_apply_details where id = #{id,jdbcType=INTEGER} + - delete from lease_apply_details where id = #{id,jdbcType=INTEGER} + + + delete from lease_apply_details + where parennt_id = #{parentId,jdbcType=INTEGER} + + insert into lease_apply_details (parennt_id, type_id, pre_num, 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 6634fa73..9dcb6e28 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 @@ -46,6 +46,10 @@ delete from lease_apply_details where id = #{id} + + delete from lease_apply_details where parennt_id = #{parentId} + + insert into tm_task (task_type, task_status, code, create_by, create_time, update_by, update_time, remark, company_id) values (#{taskType,jdbcType=INTEGER}, #{taskStatus,jdbcType=INTEGER}, #{code,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, @@ -438,12 +442,17 @@ - INSERT INTO tm_task_agreement ( `task_id`, `agreement_id`, `create_by`, `create_time`, `company_id` ) VALUES(#{id},#{agreementId},#{createBy},NOW(),#{companyId}) + + + update tm_task_agreement set agreement_id = #{agreementId}, update_time = now() + where task_id = #{taskId} + + + select agreement_id from bm_agreement_info + where unit_id = #{unitId} and project_id = #{projectId} + + \ No newline at end of file diff --git a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseMapper.xml b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseMapper.xml index 3fd243ef..9571caed 100644 --- a/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseMapper.xml +++ b/sgzb-modules/sgzb-base/src/main/resources/mapper/base/MaHouseMapper.xml @@ -83,11 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -176,4 +178,19 @@ ma_id = #{maId},is_bind =#{isBind} where label_id =#{labelId} + + insert into ma_maLabel + + type_id, + ma_code, + + + #{typeId}, + #{maCode}, + + + + insert into ma_machine (type_id,ma_code,create_time) + values (#{typeId},#{maCode},now()); + \ No newline at end of file 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 9d511e87..7a4bacd0 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 @@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND type_id = #{typeId} + order by m.ma_id desc diff --git a/sgzb-modules/sgzb-material/pom.xml b/sgzb-modules/sgzb-material/pom.xml index 58250b58..5e87c9f4 100644 --- a/sgzb-modules/sgzb-material/pom.xml +++ b/sgzb-modules/sgzb-material/pom.xml @@ -101,6 +101,12 @@ org.projectlombok lombok + + cn.hutool + hutool-all + 5.8.16 + compile + diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java index bcece98c..1177bc8b 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/BackApplyController.java @@ -1,5 +1,8 @@ package com.bonus.sgzb.material.controller; +import cn.hutool.core.collection.CollUtil; +import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; +import com.bonus.sgzb.base.api.domain.LeaseApplyInfo; 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; @@ -15,7 +18,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; /** -* @description 退料申请 +* @description 退料申请--后台 * @author hay * @date 2023/12/20 11:46 */ @@ -31,11 +34,11 @@ public class BackApplyController extends BaseController { */ @ApiOperation(value = "获取退料审核列表") @GetMapping("/getBackApplyList") - public TableDataInfo getBackApplyList(@RequestBody BackApplyInfo bean) + public AjaxResult getBackApplyList(BackApplyInfo bean) { startPage(); List list = backApplyService.getBackApplyList(bean); - return getDataTable(list); + return AjaxResult.success(getDataTable(list)); } @ApiOperation(value = "在用设备类型树") @@ -107,42 +110,67 @@ public class BackApplyController extends BaseController { bean.setTaskStatus("37"); // 创建任务 boolean addTaskResult = backApplyService.insertSelective(bean) > 0; + if (addTaskResult && bean.getTaskId() != null) { //任务协议表(tm_task_agreement) - Boolean addTaskAgreementRes = backApplyService.insertTaskAgreement(bean)>0; - if (addTaskAgreementRes){ - //退料任务表(back_apply_info) - Boolean addBackApply=backApplyService.insertBackApply(bean)>0; - if (addBackApply && bean.getId()!=null){ - if (!StringUtils.isEmpty(bean.getTypeId()) && !StringUtils.isEmpty(bean.getNum())){ - String[] typeId = bean.getTypeId().split(","); - String[] num = bean.getNum().split(","); - for (int i=0;i< typeId.length;i++){ - String typeIdStr=typeId[i]; - String numStr=num[i]; - bean.setTypeId(typeIdStr); - bean.setNum(numStr); - int re =backApplyService.upload(bean); - if (re<1){ - return AjaxResult.error("退料申请详情创建失败"); + Boolean addTaskAgreementRes = backApplyService.insertTaskAgreement(bean) > 0; + if (addTaskAgreementRes && bean.getBackApplyInfo() != null) { + if (CollUtil.isEmpty(bean.getBackApplyDetails())) { + return AjaxResult.error("退料设备明细为空,请重新选择后上传!"); + } + if (StringUtils.isNull(bean.getBackApplyInfo())) { + return AjaxResult.error("退料任务信息为空,请重新选择后上传!"); + } + + Integer taskId = bean.getTaskId(); + // 根据设备所属分公司拆分集合 + List> backApplyInfoList = CollUtil.groupByField(bean.getBackApplyDetails(), "companyId"); + // 对拆分后的集合进行each遍历 + for (List leaseApplyDetailsList : backApplyInfoList) { + // 判断拆分后的集合内是否有数据 + if (CollUtil.isNotEmpty(leaseApplyDetailsList)) { + // 对领料任务表的对象做数据处理 + BackApplyInfo backApplyInfo = bean.getBackApplyInfo(); + backApplyInfo.setCode(code); // 创建领料单号 + backApplyInfo.setTaskId(taskId); // 设置任务ID + backApplyInfo.setCompanyId(leaseApplyDetailsList.get(0).getCompanyId()); // 设置设备所属分公司,用于交给哪家审核 + + // 创建领料任务,返回领料任务编号 + boolean addLeaseTaskResult = backApplyService.insertBackApply(backApplyInfo) > 0; + // 领料任务创建完成,进行领料任务明细插入 + if (addLeaseTaskResult) { + // 领料任务编号 + Long backApplyInfoId = backApplyInfo.getId(); + if (StringUtils.isNotNull(backApplyInfoId)) { + for (BackApplyInfo leaseApplyDetails : leaseApplyDetailsList) { + leaseApplyDetails.setId(backApplyInfoId); // 设置领料任务ID + // 插入领料任务明细 + boolean addLeaseTaskDetailsResult = backApplyService.upload(leaseApplyDetails) > 0; + if (!addLeaseTaskDetailsResult) { + return AjaxResult.error("退料任务创建成功,但退料任务明细插入失败"); + } + } + return AjaxResult.success("退料申请成功,已完成"); + } else { + return AjaxResult.error("退料任务编号为空"); } + } else { + return AjaxResult.error("创建退料任务失败,或退料明细为空"); } }else { - return AjaxResult.error("未获取到物料类型或数量"); + return AjaxResult.error("创建任务失败,缺少数据"); } - }else { - return AjaxResult.error("创建退料申请失败"); } - }else { - return AjaxResult.error("创建任务协议失败"); + } else { + return AjaxResult.error("创建任务失败"); } - } else { + }else { return AjaxResult.error("创建任务失败"); } - return AjaxResult.success("退料申请创建成功,已完成"); } catch (Exception e) { return AjaxResult.error("创建任务失败," + e.getCause().toString() + "," + e.getMessage()); } + return AjaxResult.error("任务创建失败"); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java index bd72094a..0fcee176 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/PurchaseMacodeInfoController.java @@ -7,6 +7,7 @@ import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; import com.bonus.sgzb.material.vo.EquipmentNumberVO; +import com.bonus.sgzb.material.vo.MaInputVO; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -65,13 +66,24 @@ public class PurchaseMacodeInfoController extends BaseController return success(purchaseMacodeInfoService.selectPurchaseMacodeInfo(purchaseMacodeInfo)); } + /** + * 获取新购验收编号管理详细信息 + */ + @ApiOperation(value = "新购入库清单明细") + @GetMapping(value = "/putinDetails") + public TableDataInfo putinDetails(PurchaseMacodeInfo purchaseMacodeInfo) + { + startPage(); + return getDataTable(purchaseMacodeInfoService.selectPutinDetails(purchaseMacodeInfo)); + } + /** * 新增新购验收编号管理 */ @ApiOperation(value = "新增新购验收编号管理") @PostMapping public AjaxResult add(@RequestBody List purchaseMacodeInfoList) throws Exception { - return toAjax(purchaseMacodeInfoService.insertPurchaseMacodeInfo(purchaseMacodeInfoList)); + return purchaseMacodeInfoService.insertPurchaseMacodeInfo(purchaseMacodeInfoList); } /** @@ -104,8 +116,8 @@ public class PurchaseMacodeInfoController extends BaseController */ @ApiOperation(value = "修改编码管理的入库状态") @PutMapping("/manageStatus") - public AjaxResult modifyManageStatus(@RequestBody MaInputRecord maInputRecord) throws Exception { - return toAjax(purchaseMacodeInfoService.modifyManageStatus(maInputRecord)); + public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception { + return toAjax(purchaseMacodeInfoService.modifyManageStatus(maInputVO)); } /** diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairTestInputController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairTestInputController.java index a8448a26..fb1c5a97 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairTestInputController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/RepairTestInputController.java @@ -33,6 +33,13 @@ public class RepairTestInputController extends BaseController { return getDataTable(list); } + @ApiOperation(value = "获取修试后入库列表") + @PostMapping("getAppRepairedList") + public AjaxResult getAppRepairedList(@Validated @RequestBody RepairTestInputDto dto){ + List list = service.getRepairedList(dto); + return AjaxResult.success(list); + } + @ApiOperation(value = "获取修试后入库列表-详情") @GetMapping("getRepairedDetailList") public TableDataInfo getRepairedDetailList(RepairTestInputDto dto){ @@ -41,6 +48,13 @@ public class RepairTestInputController extends BaseController { return getDataTable(list); } + @ApiOperation(value = "获取修试后入库列表-详情") + @PostMapping("getAppRepairedDetailList") + public AjaxResult getAppRepairedDetailList(@Validated @RequestBody RepairTestInputDto dto){ + List list = service.getRepairedDetailList(dto); + return AjaxResult.success(list); + } + @ApiOperation(value = "修试后入库-入库操作") @PostMapping("inputByType") public AjaxResult inputByType(@RequestBody RepairTestInputDto dto){ diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java index 8899b53b..ede86674 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/BackApplyInfo.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.domain; +import com.bonus.sgzb.base.api.domain.LeaseApplyInfo; import com.bonus.sgzb.common.core.annotation.Excel; import com.bonus.sgzb.common.core.web.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; @@ -7,6 +8,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; +import java.util.List; /** * @description 退料 @@ -164,4 +166,23 @@ public class BackApplyInfo extends BaseEntity { @ApiModelProperty(value = "等级") private String level; + + /** + * 退料任务实体 + */ + @ApiModelProperty(value="退料任务实体") + private BackApplyInfo backApplyInfo; + + /** + * 退料任务实体集合 + */ + @ApiModelProperty(value="退料任务实体集合") + private List backApplyInfoList; + + /** + * 退料任务实体集合 + */ + @ApiModelProperty(value="退料任务实体集合") + private List backApplyDetails; + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaInputRecord.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaInputRecord.java index 9109a1d2..37571ef8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaInputRecord.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/MaInputRecord.java @@ -20,39 +20,37 @@ public class MaInputRecord extends BaseEntity private static final long serialVersionUID = 1L; /** $column.columnComment */ + @ApiModelProperty(value = "主键id") private Long id; /** 任务ID */ - @Excel(name = "任务ID") + @ApiModelProperty(value = "任务ID") private Long taskId; /** 类型ID */ - @Excel(name = "类型ID") + @ApiModelProperty(value = "类型ID") private Long typeId; /** 机具ID */ - @Excel(name = "机具ID") + @ApiModelProperty(value = "机具ID") private Long maId; /** 入库类型(1新购入库,2退料入库,3修试后入库) */ - @Excel(name = "入库类型(1新购入库,2退料入库,3修试后入库)") + @ApiModelProperty(value = "入库类型(1新购入库,2退料入库,3修试后入库)") private String inputType; /** 入库数量 */ - @Excel(name = "入库数量") + @ApiModelProperty(value = "入库数量") private BigDecimal inputNum; /** 状态(0删除,1正常) */ - @Excel(name = "状态", readConverterExp = "0=删除,1正常") + @ApiModelProperty(value = "状态 0=删除,1正常") private String status; /** 数据所属组织 */ - @Excel(name = "数据所属组织") + @ApiModelProperty(value = "数据所属组织") private Long companyId; - @ApiModelProperty("验收的编码id") - private List maCodeInfoIdList; - @ApiModelProperty(value = "验收结论") private String checkResult; @@ -134,13 +132,6 @@ public class MaInputRecord extends BaseEntity return companyId; } - public List getMaCodeInfoIdList() { - return maCodeInfoIdList; - } - - public void setMaCodeInfoIdList(List maCodeInfoIdList) { - this.maCodeInfoIdList = maCodeInfoIdList; - } public String getCheckResult() { return checkResult; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java index 07a6501d..f99b3da8 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseCheckDetails.java @@ -98,6 +98,12 @@ public class PurchaseCheckDetails extends BaseEntity @ApiModelProperty(value = "规格型号") private String specificationType; + @ApiModelProperty(value = "规格型号") + private String typeName; + + @ApiModelProperty(value = "单位") + private String unitName; + @ApiModelProperty(value = "机具类型名称") private String machineTypeName; @@ -302,6 +308,22 @@ public class PurchaseCheckDetails extends BaseEntity this.bindNum = bindNum; } + public String getTypeName() { + return typeName; + } + + public void setTypeName(String typeName) { + this.typeName = typeName; + } + + public String getUnitName() { + return unitName; + } + + public void setUnitName(String unitName) { + this.unitName = unitName; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java index db74092c..f6140716 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/PurchaseMacodeInfo.java @@ -102,6 +102,13 @@ public class PurchaseMacodeInfo extends BaseEntity @ApiModelProperty(value = "出厂日期") private Date productionTime; + /** 到货日期 */ + @ApiModelProperty(value = "到货日期") + private String arrivalTime; + + @ApiModelProperty(value = "0,正常 1, 重复数据") + private int statusFlag; + public Long getId() { return id; } @@ -278,6 +285,22 @@ public class PurchaseMacodeInfo extends BaseEntity this.assetsCode = assetsCode; } + public String getArrivalTime() { + return arrivalTime; + } + + public void setArrivalTime(String arrivalTime) { + this.arrivalTime = arrivalTime; + } + + public int getStatusFlag() { + return statusFlag; + } + + public void setStatusFlag(int statusFlag) { + this.statusFlag = statusFlag; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/TypeTreeNode.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/TypeTreeNode.java new file mode 100644 index 00000000..dcfa8702 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/TypeTreeNode.java @@ -0,0 +1,29 @@ +package com.bonus.sgzb.material.domain; + +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * 下拉树-实体类 + */ +@Data +public class TypeTreeNode { + + private long typeId; + + private long parentId; + + private String num; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private String level; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private String typeName; + + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private List children = new ArrayList<>(); +} 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 8fd11290..32d9264f 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 @@ -1,5 +1,6 @@ package com.bonus.sgzb.material.mapper; +import com.bonus.sgzb.base.api.domain.LeaseApplyDetails; import com.bonus.sgzb.material.domain.AgreementInfo; import com.bonus.sgzb.material.domain.BackApplyInfo; import com.bonus.sgzb.material.domain.TypeTreeNode; diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java index 2c21ef7f..59328115 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseCheckDetailsMapper.java @@ -4,6 +4,7 @@ import com.bonus.sgzb.material.domain.PurchaseCheckDetails; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; /** @@ -71,4 +72,10 @@ public interface PurchaseCheckDetailsMapper { int deleteCheckDetailsByTaskId(Long taskId); int updateByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails); + + int updateBindByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails); + + BigDecimal selectInputNUmByTypeId(@Param("taskId") Long taskId, @Param("typeId") Long typeId); + + Integer selectBindNUmByTypeId(@Param("typeId") Long typeId, @Param("taskId") Long taskId); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java index 41aa1220..2dcb949d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/mapper/PurchaseMacodeInfoMapper.java @@ -96,4 +96,10 @@ public interface PurchaseMacodeInfoMapper { int deleteMaMachineInfoByMaCode(String maCode); List selectPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo); + + List selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo); + + int selectMaCode(String maCode); + + int updateMacodeByType(PurchaseMacodeInfo purchaseMacodeInfo); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java index c9d67558..e069255b 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/IPurchaseMacodeInfoService.java @@ -1,9 +1,11 @@ package com.bonus.sgzb.material.service; import com.alibaba.fastjson.JSONObject; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.domain.PurchaseMacodeInfo; import com.bonus.sgzb.material.vo.EquipmentNumberVO; +import com.bonus.sgzb.material.vo.MaInputVO; import java.util.List; @@ -37,7 +39,7 @@ public interface IPurchaseMacodeInfoService * @param purchaseMacodeInfoList 新购验收编号管理purchase_macode_info * @return 结果 */ - public int insertPurchaseMacodeInfo(List purchaseMacodeInfoList) throws Exception; + public AjaxResult insertPurchaseMacodeInfo(List purchaseMacodeInfoList) throws Exception; /** * 修改新购验收编号管理purchase_macode_info @@ -67,9 +69,12 @@ public interface IPurchaseMacodeInfoService int deletePurchaseMacodeInfoById(Long id); - int modifyManageStatus(MaInputRecord maInputRecord); + int modifyManageStatus(MaInputVO maInputVO); int deletePurchaseMacodeInfoByMaCode(String maCode); List selectPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo); + + List selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo); + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java index efa47473..590c7f14 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/service/impl/PurchaseCheckDetailsServiceImpl.java @@ -89,7 +89,7 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer // macodeInfoService.insertPurchaseMacodeInfo(macodeInfo); // } } else if ("不通过".equals(purchaseCheckDetails.getCheckResult())) { - purchaseCheckDetails.setStatus(0); + purchaseCheckDetails.setStatus(3); } else { purchaseCheckDetails.setStatus(2); } 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 72476a36..3d04a4d9 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 @@ -11,6 +11,8 @@ import com.bonus.sgzb.base.api.domain.MaMachine; import com.bonus.sgzb.base.api.domain.MaType; import com.bonus.sgzb.base.api.domain.TmTask; import com.bonus.sgzb.common.core.utils.StringUtils; +import com.bonus.sgzb.common.core.web.domain.AjaxResult; +import com.bonus.sgzb.common.security.utils.SecurityUtils; import com.bonus.sgzb.material.domain.BmQrcodeInfo; import com.bonus.sgzb.material.domain.MaInputRecord; import com.bonus.sgzb.material.domain.PurchaseCheckDetails; @@ -19,6 +21,7 @@ import com.bonus.sgzb.material.mapper.*; import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService; import com.bonus.sgzb.common.core.utils.DateUtils; import com.bonus.sgzb.material.vo.EquipmentNumberVO; +import com.bonus.sgzb.material.vo.MaInputVO; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -46,7 +49,6 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService private PurchaseCheckDetailsMapper checkDetailsMapper; - /** * 查询新购验收编号管理 * @@ -76,10 +78,27 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService * @return 结果 */ @Override - public int insertPurchaseMacodeInfo(List purchaseMacodeInfoList) throws Exception { + @Transactional + public AjaxResult insertPurchaseMacodeInfo(List purchaseMacodeInfoList) throws Exception { + boolean b = true; + for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) { + int i = purchaseMacodeInfoMapper.selectMaCode(purchaseMacodeInfo.getMaCode()); + if (i > 0) { + purchaseMacodeInfo.setStatusFlag(1); + b = false; + } else { + purchaseMacodeInfo.setStatusFlag(0); + } + } + if (!b) { + return AjaxResult.success(purchaseMacodeInfoList); + } + PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) { Long typeId = purchaseMacodeInfo.getTypeId(); String maCode = purchaseMacodeInfo.getMaCode(); + purchaseCheckDetails.setTypeId(typeId); + purchaseCheckDetails.setTaskId(purchaseMacodeInfo.getTaskId()); if (StringUtils.isNotEmpty(maCode)) { MaMachine maMachine = new MaMachine(); maMachine.setTypeId(typeId); @@ -96,6 +115,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService } maMachine.setMaCode(maCode); maMachine.setCreateTime(new Date()); + maMachine.setCreateBy(SecurityUtils.getUsername()); purchaseMacodeInfoMapper.maMachineAdd(maMachine); } String qrCode = purchaseMacodeInfo.getQrCode(); @@ -112,8 +132,12 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService purchaseMacodeInfo.setCreateTime(DateUtils.getNowDate()); purchaseMacodeInfoMapper.insertPurchaseMacodeInfo(purchaseMacodeInfo); } - - return 1; + Integer bindNum = checkDetailsMapper.selectBindNUmByTypeId(purchaseCheckDetails.getTypeId(), purchaseCheckDetails.getTaskId()); + // 添加绑定数量 + purchaseCheckDetails.setBindNum(bindNum + purchaseMacodeInfoList.size()); + purchaseCheckDetails.setUpdateTime(new Date()); + checkDetailsMapper.updateBindByTaskIdTypeId(purchaseCheckDetails); + return AjaxResult.success(new ArrayList()); } @@ -125,10 +149,12 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService */ @Override public int updatePurchaseMacodeInfo(List purchaseMacodeInfoList) throws Exception { + for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) { Long typeId = purchaseMacodeInfo.getTypeId(); String maCode = purchaseMacodeInfo.getMaCode(); + if (StringUtils.isNotEmpty(maCode)) { MaMachine maMachine = new MaMachine(); maMachine.setTypeId(typeId); @@ -160,6 +186,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService purchaseMacodeInfo.setUpdateTime(DateUtils.getNowDate()); purchaseMacodeInfoMapper.updatePurchaseMacodeInfo(purchaseMacodeInfo); } + return 1; } @@ -208,17 +235,17 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService for (int i = 0; i < equipmentNumberVO.getCount(); i++) { int i1 = count + i; // 编码规则 - String codingRule = "NXJJ" + typeCode + format + specsCode; + String codingRule = "NSJJ" + specsCode + format + typeCode; String codeNum = ""; String code = format; String code1 = format; - if (i1>9 && i1<100){ + if (i1 > 9 && i1 < 100) { codeNum = "-00" + i1; code1 = "-00" + i1; - }else if (i1>99 && i1<1000){ - codeNum = "-0" + i1; - code1 = "-0" + i1; - }else { + } else if (i1 > 99 && i1 < 1000) { + codeNum = "-0" + i1; + code1 = "-0" + i1; + } else { codeNum = "-000" + i1; code1 = "-000" + i1; } @@ -233,14 +260,15 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService } JSONObject result = new JSONObject(); - result.put("equipmentNum",list); - result.put("twoDimensionalCode",codeList); + result.put("equipmentNum", list); + result.put("twoDimensionalCode", codeList); return result; } /** * 删除机具编码 + * * @param id 机具编码id * @return 结果 */ @@ -251,52 +279,62 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService /** * 修改编码管理的入库状态 - * @param maInputRecord 入库信息 + * + * @param maInputVO 入库信息 * @return 结果 */ @Override - public int modifyManageStatus(MaInputRecord maInputRecord) { - Long taskId = maInputRecord.getTaskId(); - Long typeId = maInputRecord.getTypeId(); - String checkResult = maInputRecord.getCheckResult(); - List maCodeInfoIdList = maInputRecord.getMaCodeInfoIdList(); - // 修改编码管理的入库状态 - for (Long maCodeInfoId : maCodeInfoIdList) { - MaType maType = purchaseMacodeInfoMapper.selectTypeByTypeId(typeId); - // 库存添加 - maType.setNum(String.valueOf(maInputRecord.getInputNum().add(new BigDecimal(Integer.parseInt(maType.getNum()))))); - purchaseMacodeInfoMapper.updateTypeByTypeId(maType); + public int modifyManageStatus(MaInputVO maInputVO) { + Long taskId = maInputVO.getTaskId(); + String checkResult = maInputVO.getCheckResult(); + List inputRecordList = maInputVO.getInputRecordList(); + for (MaInputRecord maInputRecord : inputRecordList) { + Long typeId = maInputRecord.getTypeId(); + // 修改机具入库状态 MaMachine maMachine = new MaMachine(); maMachine.setMaId(maInputRecord.getMaId()); maMachine.setMaCode(maInputRecord.getMaCode()); - maMachine.setMaStatus("15"); + maMachine.setMaStatus("1".equals(checkResult) ? "15":"14"); purchaseMacodeInfoMapper.updateMaMachine(maMachine); // 修改验收任务详细表入库数量 - PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); - purchaseCheckDetails.setTaskId(taskId); - purchaseCheckDetails.setTypeId(typeId); - purchaseCheckDetails.setInputNum(maInputRecord.getInputNum()); - checkDetailsMapper.updateByTaskIdTypeId(purchaseCheckDetails); + if ("1".equals(checkResult)) { + // 修改编码管理的入库状态 + MaType maType = purchaseMacodeInfoMapper.selectTypeByTypeId(typeId); + // 库存添加 + maType.setNum((maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum()) + .add(maType.getNum() == null ? new BigDecimal(0):maType.getNum())); + purchaseMacodeInfoMapper.updateTypeByTypeId(maType); + + BigDecimal inputNum = checkDetailsMapper.selectInputNUmByTypeId(taskId, typeId); + PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); + purchaseCheckDetails.setTaskId(taskId); + purchaseCheckDetails.setTypeId(typeId); + purchaseCheckDetails.setInputNum(inputNum.add(maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum())); + purchaseCheckDetails.setStatus(4); + checkDetailsMapper.updateByTaskIdTypeId(purchaseCheckDetails); + } // 修改编码管理表入库状态 PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo(); - purchaseMacodeInfo.setId(maCodeInfoId); purchaseMacodeInfo.setTaskId(taskId); - purchaseMacodeInfo.setStatus("通过".equals(checkResult) ? "54":"55"); - purchaseMacodeInfoMapper.updatePurchaseMacodeInfo(purchaseMacodeInfo); + purchaseMacodeInfo.setTypeId(typeId); + purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode()); + purchaseMacodeInfo.setStatus("1".equals(checkResult) ? "1" : "0"); + purchaseMacodeInfoMapper.updateMacodeByType(purchaseMacodeInfo); // 新增入库记录 purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord); } + // 当全部为已入库的时候任务改为入库状态 Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId); if (count <= 0) { TmTask task = new TmTask(); task.setTaskId(taskId); - task.setTaskStatus(54); + task.setTaskStatus(28); taskMapper.updateTmTask(task); } @@ -305,6 +343,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService /** * 根据机具编码删除编码 + * * @param maCode 机具编码 * @return 结果 */ @@ -317,6 +356,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService /** * 根据类型id和任务id查询编码详情 + * * @param purchaseMacodeInfo * @return 结果 */ @@ -325,4 +365,15 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService return purchaseMacodeInfoMapper.selectPurchaseMacodeInfo(purchaseMacodeInfo); } + /** + * 获取入库清单明细 + * + * @param purchaseMacodeInfo 查询条件 + * @return 结果 + */ + @Override + public List selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) { + return purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo); + } + } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/MaInputVO.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/MaInputVO.java new file mode 100644 index 00000000..02f0a192 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/MaInputVO.java @@ -0,0 +1,25 @@ +package com.bonus.sgzb.material.vo; + +import com.bonus.sgzb.material.domain.MaInputRecord; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.List; + +@Data +public class MaInputVO { + + + /** 任务ID */ + @ApiModelProperty(value = "任务ID") + private Long taskId; + + @ApiModelProperty(value = "验收结论") + private String checkResult; + + /** + * 入库记录 + */ + private List inputRecordList; + +} diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/TypeTreeBuild.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/TypeTreeBuild.java new file mode 100644 index 00000000..7726dec9 --- /dev/null +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/vo/TypeTreeBuild.java @@ -0,0 +1,79 @@ +package com.bonus.sgzb.material.vo; + +import com.bonus.sgzb.material.domain.TypeTreeNode; + +import java.util.ArrayList; +import java.util.List; + +/** + * BuildTree 构建树形结构 + * @author 10488 + */ +public class TypeTreeBuild { + + public List nodeList = new ArrayList<>(); + + /** + * 构造方法 + * @param nodeList 将数据集合赋值给nodeList,即所有数据作为所有节点。 + */ + public TypeTreeBuild(List nodeList){ + this.nodeList = nodeList; + } + + /** + * 获取需构建的所有根节点(顶级节点) "0" + * @return 所有根节点List集合 + */ + public List getRootNode(){ + // 保存所有根节点(所有根节点的数据) + List rootNodeList = new ArrayList<>(); + // treeNode:查询出的每一条数据(节点) + for (TypeTreeNode treeNode : nodeList){ + // 判断当前节点是否为根节点,此处注意:若parentId类型是String,则要采用equals()方法判断。 + if (0 == treeNode.getParentId()) { + // 是,添加 + rootNodeList.add(treeNode); + } + } + return rootNodeList; + } + + /** + * 根据每一个顶级节点(根节点)进行构建树形结构 + * @return 构建整棵树 + */ + public List buildTree(){ + // treeNodes:保存一个顶级节点所构建出来的完整树形 + List treeNodes = new ArrayList(); + // getRootNode():获取所有的根节点 + for (TypeTreeNode treeRootNode : getRootNode()) { + // 将顶级节点进行构建子树 + treeRootNode = buildChildTree(treeRootNode); + // 完成一个顶级节点所构建的树形,增加进来 + treeNodes.add(treeRootNode); + } + return treeNodes; + } + + /** + * 递归-----构建子树形结构 + * @param pNode 根节点(顶级节点) + * @return 整棵树 + */ + public TypeTreeNode buildChildTree(TypeTreeNode pNode){ + List childTree = new ArrayList(); + // nodeList:所有节点集合(所有数据) + for (TypeTreeNode treeNode : nodeList) { + // 判断当前节点的父节点ID是否等于根节点的ID,即当前节点为其下的子节点 + if (treeNode.getParentId() == pNode.getTypeId()) { + // 再递归进行判断当前节点的情况,调用自身方法 + childTree.add(buildChildTree(treeNode)); + } + } + // for循环结束,即节点下没有任何节点,树形构建结束,设置树结果 + pNode.setChildren(childTree); + return pNode; + } + +} 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 b8a90977..4640cc23 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 @@ -187,7 +187,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) - + insert into back_apply_details ( 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 1df9c1d1..59d52a8f 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 @@ -35,7 +35,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select pcd.id,pcd.task_id, pcd.type_id, pcd.purchase_price, pcd.purchase_num, pcd.check_num, pcd.check_result, pcd.supplier_id, pcd.status, msi.supplier, pcd.create_by, pcd.production_time, pcd.create_time, pcd.check_url_name, pcd.check_url, pcd.file_name, pcd.file_url,pcd.update_by, pcd.update_time, pcd.remark, pcd.company_id, - mt1.type_name machineTypeName,mt.type_name specificationType, mt.manage_type manageType, tk.code + mt1.type_name machineTypeName,mt.type_name specificationType, mt.manage_type manageType, tk.code ,mt.type_name typeName, + mt.unit_name unitName from purchase_check_details pcd left join ma_type mt on pcd.type_id = mt.type_id left join ma_type mt1 on mt.parent_id = mt1.type_id @@ -196,12 +197,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + delete from purchase_check_details where task_id = #{taskId} - update purchase_check_details set check_num = #{checkNum} where task_id = #{taskId} and type_id = #{typeId} + update purchase_check_details set check_num = #{checkNum},status = #{status} where task_id = #{taskId} and type_id = #{typeId} + + + update purchase_check_details set status = '0' where task_id = #{taskId} + + + update purchase_check_details set bind_num = #{bindNum} where task_id = #{taskId} and type_id = #{typeId} \ No newline at end of file diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml index 60f3adc7..ba6a973d 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckInfoMapper.xml @@ -144,15 +144,17 @@ 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/PurchaseMacodeInfoMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml index a4c52b06..3c1061a4 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseMacodeInfoMapper.xml @@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select count(*) from purchase_macode_info where task_id = #{taskId} and status != '54' + select count(*) from purchase_macode_info where task_id = #{taskId} and status != '1' @@ -256,6 +257,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" pcd.production_time = #{productionTime} + + update ma_type set num = #{num} where type_id = #{typeId} @@ -264,4 +280,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update ma_machine set ma_status = #{maStatus} where ma_id = #{maId} + + update purchase_macode_info set status = #{status} where task_id = #{taskId} and type_id = #{typeId} + and ma_code = #{maCode} + \ No newline at end of file diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java index 3ef7e9ba..1b92733c 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/controller/PurchaseNoticePersonController.java @@ -2,6 +2,7 @@ package com.bonus.sgzb.system.controller; import java.util.List; +import com.bonus.sgzb.system.api.domain.SysUser; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -53,9 +54,9 @@ public class PurchaseNoticePersonController extends BaseController @ApiOperation(value ="新增新购短信通知人员") @Log(title = "新购短信通知人员", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody PurchaseNoticePerson purchaseNoticePerson) + public AjaxResult add(@RequestBody List purchaseNoticePersonList) { - return toAjax(purchaseNoticePersonService.insertPurchaseNoticePerson(purchaseNoticePerson)); + return toAjax(purchaseNoticePersonService.insertPurchaseNoticePersonList(purchaseNoticePersonList)); } /** @@ -63,9 +64,20 @@ public class PurchaseNoticePersonController extends BaseController */ @RequiresPermissions("删除新购短信通知人员") @Log(title = "删除新购短信通知人员", businessType = BusinessType.DELETE) - @DeleteMapping("/{id}") - public AjaxResult remove(@PathVariable Long id) + @DeleteMapping("/{userId}") + public AjaxResult remove(@PathVariable Long userId) { - return toAjax(purchaseNoticePersonService.deletePurchaseNoticePersonById(id)); + return toAjax(purchaseNoticePersonService.deletePurchaseNoticePersonById(userId)); + } + + + /** + * 通知人员添加查询接口 + * @param sysUser + * @return + */ + @GetMapping("/notification") + public AjaxResult notification(SysUser sysUser) { + return success(purchaseNoticePersonService.getUserByRoleList(sysUser)); } } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java index b723e1a3..f8ee7d3c 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/domain/TreeNode.java @@ -25,6 +25,9 @@ public class TreeNode { @JsonInclude(JsonInclude.Include.NON_EMPTY) private String unitName; + @JsonInclude(JsonInclude.Include.NON_EMPTY) + private String companyId; + @JsonInclude(JsonInclude.Include.NON_EMPTY) private List children = new ArrayList<>(); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java index 1df292e0..cc36f641 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/mapper/PurchaseNoticePersonMapper.java @@ -1,6 +1,8 @@ package com.bonus.sgzb.system.mapper; import java.util.List; + +import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.domain.PurchaseNoticePerson; import org.apache.ibatis.annotations.Mapper; @@ -48,10 +50,10 @@ public interface PurchaseNoticePersonMapper /** * 删除新购短信通知人员purchase_notice_person * - * @param id 新购短信通知人员purchase_notice_person主键 + * @param userId 新购短信通知人员purchase_notice_person主键 * @return 结果 */ - public int deletePurchaseNoticePersonById(Long id); + public int deletePurchaseNoticePersonById(Long userId); /** * 批量删除新购短信通知人员purchase_notice_person @@ -60,4 +62,6 @@ public interface PurchaseNoticePersonMapper * @return 结果 */ public int deletePurchaseNoticePersonByIds(Long[] ids); + + List getUserByRoleList(SysUser sysUser); } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/IPurchaseNoticePersonService.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/IPurchaseNoticePersonService.java index c8cfd8dd..c2c2ec54 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/IPurchaseNoticePersonService.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/IPurchaseNoticePersonService.java @@ -1,6 +1,8 @@ package com.bonus.sgzb.system.service; import java.util.List; + +import com.bonus.sgzb.system.api.domain.SysUser; import com.bonus.sgzb.system.domain.PurchaseNoticePerson; /** @@ -54,8 +56,13 @@ public interface IPurchaseNoticePersonService /** * 删除新购短信通知人员purchase_notice_person信息 * - * @param id 新购短信通知人员purchase_notice_person主键 + * @param userId 新购短信通知人员purchase_notice_person主键 * @return 结果 */ - public int deletePurchaseNoticePersonById(Long id); + public int deletePurchaseNoticePersonById(Long userId); + + List getUserByRoleList(SysUser sysUser); + + int insertPurchaseNoticePersonList(List purchaseNoticePersonList); + } diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java index ec623671..41d90d29 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/PurchaseNoticePersonServiceImpl.java @@ -1,6 +1,8 @@ package com.bonus.sgzb.system.service.impl; import java.util.List; + +import com.bonus.sgzb.system.api.domain.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper; @@ -84,12 +86,35 @@ public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonSer /** * 删除新购短信通知人员purchase_notice_person信息 * - * @param id 新购短信通知人员purchase_notice_person主键 + * @param userId 新购短信通知人员purchase_notice_person主键 * @return 结果 */ @Override - public int deletePurchaseNoticePersonById(Long id) + public int deletePurchaseNoticePersonById(Long userId) { - return purchaseNoticePersonMapper.deletePurchaseNoticePersonById(id); + return purchaseNoticePersonMapper.deletePurchaseNoticePersonById(userId); + } + + /** + * 查询添加人员 + * @param sysUser + * @return + */ + @Override + public List getUserByRoleList(SysUser sysUser) { + return purchaseNoticePersonMapper.getUserByRoleList(sysUser); + } + + /** + * 批量添加人员 + * @param purchaseNoticePersonList + * @return + */ + @Override + public int insertPurchaseNoticePersonList(List purchaseNoticePersonList) { + for (PurchaseNoticePerson purchaseNoticePerson : purchaseNoticePersonList) { + insertPurchaseNoticePerson(purchaseNoticePerson); + } + return 1; } } diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml index b206e6a5..7055873e 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/PurchaseNoticePersonMapper.xml @@ -24,7 +24,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join sys_dept d on u.dept_id = d.dept_id left join sys_dept d1 on d.parent_id = d1.dept_id left join sys_dept d2 on d1.parent_id = d2.dept_id - where r.role_id = #{roleId} and u.status = '0' + where u.status = '0' @@ -32,17 +32,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - + + insert into purchase_notice_person - id, user_id, user_name, telphone, - #{id}, #{userId}, #{userName}, #{telphone}, @@ -60,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from purchase_notice_person where id = #{id} + delete from purchase_notice_person where user_id = #{userId} diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml index 0eeed8c2..0488276b 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SelectMapper.xml @@ -93,7 +93,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT type_id AS id, type_name AS label, parent_id AS parentId, - unit_name AS unitName + unit_name AS unitName, + company_id AS companyId FROM ma_type WHERE del_flag = '0' @@ -150,7 +151,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id AS parentId, level FROM ma_part_type - WHERE del_flag = '0' and level != '4' + WHERE del_flag = '0' and level != '3' ORDER BY create_time diff --git a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml index 91d6c5ec..3547a57d 100644 --- a/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/sgzb-modules/sgzb-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -229,6 +229,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" u.remark from sys_user u left join sys_user_role sur on u.user_id = sur.user_id - where u.status = '0' and u.del_flag = '0' and sur.role_id = #{roleId} + where u.status = '0' and u.del_flag = '0' + + and sur.role_id = #{roleId} + \ No newline at end of file diff --git a/sgzb-ui/src/api/store/newBuy.js b/sgzb-ui/src/api/store/newBuy.js index b3045a72..fb6ad59b 100644 --- a/sgzb-ui/src/api/store/newBuy.js +++ b/sgzb-ui/src/api/store/newBuy.js @@ -133,18 +133,64 @@ export function delMacodeList(maCode) { }) } - - - - - - - - - - - - +//新购验收-验收-通知-常用人员 +export function getNoticeUserList(query) { + return request({ + url: '/system/person/list', + method: 'get', + params: query + }) +} +//新购验收-验收-通知-所有人员 +export function getAllNotificationList(query) { + return request({ + url: '/system/person/notification', + method: 'get', + params: query + }) +} +//新购验收-验收-通知-常用人员-添加 +export function addNoticeUser(data) { + return request({ + url: '/system/person', + method: 'post', + data: data + }) +} +// 删除 +export function delNoticeUser(id) { + return request({ + url: '/system/person/' + id, + method: 'delete' + }) +} + + + +//新购验收-入库列表 +export function getPutInList(query) { + return request({ + url: '/material/purchaseCheckInfo/putInList', + method: 'get', + params: query + }) +} +export function getPutinDetailsList(query) { + return request({ + url: '/material/purchaseMacode/putinDetails', + method: 'get', + params: query + }) +} + +// 修改状态-审核 +export function changePutinStatus(data) { + return request({ + url: '/material/purchaseMacode/manageStatus', + method: 'put', + data: data + }) +} diff --git a/sgzb-ui/src/api/store/warehousing.js b/sgzb-ui/src/api/store/warehousing.js index 0b18cccd..f1cabc18 100644 --- a/sgzb-ui/src/api/store/warehousing.js +++ b/sgzb-ui/src/api/store/warehousing.js @@ -23,24 +23,24 @@ export function getTypeList(query) { //修试后入库--列表 export function getRepairedList(data) { return request({ - url: '/material/RepairTestInput/getRepairedList', - method: 'post', - data: data + url: '/sgzb-material/RepairTestInput/getRepairedList', + method: 'get', + params: data }) } //修试后入库--详情 export function getRepairedDetailList(data) { return request({ - url: '/material//RepairTestInput/getRepairedDetailList', - method: 'post', - data: data + url: '/sgzb-material//RepairTestInput/getRepairedDetailList', + method: 'get', + params: data }) } //修试后入库--审核 export function inputByType(data) { return request({ - url: '/material/RepairTestInput/inputByType', + url: '/sgzb-material/RepairTestInput/inputByType', method: 'post', data: data }) diff --git a/sgzb-ui/src/views/base/section/index.vue b/sgzb-ui/src/views/base/section/index.vue index 1a16e0cc..15155e83 100644 --- a/sgzb-ui/src/views/base/section/index.vue +++ b/sgzb-ui/src/views/base/section/index.vue @@ -1,6 +1,13 @@ + + diff --git a/sgzb-ui/src/views/store/newBuy/newDevices/newDevicesList.vue b/sgzb-ui/src/views/store/newBuy/newDevices/newDevicesList.vue index 85cecf00..d3121124 100644 --- a/sgzb-ui/src/views/store/newBuy/newDevices/newDevicesList.vue +++ b/sgzb-ui/src/views/store/newBuy/newDevices/newDevicesList.vue @@ -98,6 +98,7 @@ size="mini" type="text" icon="el-icon-edit" + v-if="scope.row.purchasingStatus=='已验收合格'" @click="handleCode(scope.row)" >编码管理
- - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + 查询 @@ -59,7 +58,7 @@ - + @@ -92,7 +91,7 @@ - + - - - - - - - - - - - - - - - - - - -