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"
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/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/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..64373612 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();
}
@@ -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,59 @@ 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();
+ List inputRecordList = maInputVO.getInputRecordList();
+ for (MaInputRecord maInputRecord : inputRecordList) {
+ Long typeId = maInputRecord.getTypeId();
+ String checkResult = maInputRecord.getCheckResult();
// 修改机具入库状态
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(String.valueOf(maInputRecord.getInputNum().add(new BigDecimal(Integer.parseInt(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()));
+ 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.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 +340,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
/**
* 根据机具编码删除编码
+ *
* @param maCode 机具编码
* @return 结果
*/
@@ -317,6 +353,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
/**
* 根据类型id和任务id查询编码详情
+ *
* @param purchaseMacodeInfo
* @return 结果
*/
@@ -325,4 +362,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/resources/mapper/material/PurchaseCheckDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/PurchaseCheckDetailsMapper.xml
index 1df9c1d1..320db0b6 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,6 +197,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
delete from purchase_check_details where task_id = #{taskId}
@@ -204,4 +211,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update purchase_check_details set check_num = #{checkNum} 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..021380bd 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
@@ -154,5 +154,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and pci.arrival_time = #{arrivalTime}
and pci.purchaser = #{purchaser}
and pci.company_id = #{companyId}
+ order by pci.id desc
\ 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..1970c17b 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 pcd.production_time productionTime,mt.type_name specificationType, mt1.type_name typeName, pmi.ma_code maCode,
+ mm.assets_code assetsCode ,pmi.fix_code fixCode,pcd.type_id typeId,pcd.task_id taskId, mt.code specsCode,mt1.code typeCode,
+ if(pmi.ma_code is null, if(pcd.status != 4, 0 , pcd.status), pmi.status) status,
+ if(pmi.ma_code is not null,1,pcd.check_num) checkNum
+ from purchase_check_details pcd
+ left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
+ left join ma_machine mm on pmi.ma_code = mm.ma_code
+ left join ma_type mt on pcd.type_id = mt.type_id
+ left join ma_type mt1 on mt.parent_id = mt1.type_id
+ where pcd.task_id = #{taskId}
+
+
+ select count(ma_id) from ma_machine where ma_code = #{maCode}
+
update ma_type set num = #{num} where type_id = #{typeId}
@@ -264,4 +280,7 @@ 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}
+
\ 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/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}
-
+
+ select u.user_id userId, u.dept_id deptId, u.nick_name nickName, u.user_name userName, u.avatar, u.phonenumber telphone,
+ concat(d2.dept_name,'/',d1.dept_name,'/',d.dept_name) deptName,r.role_name roleName
+ from sys_user u
+ left join sys_user_role sur on u.user_id = sur.user_id
+ left join sys_role r on sur.role_id = r.role_id
+ 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 u.status = '0' and u.del_flag = '0' and u.user_id not in (select user_id from purchase_notice_person)
+
+
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/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