新购模块代码修改
This commit is contained in:
parent
2700fceceb
commit
a18aff4d23
|
|
@ -83,11 +83,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<select id="selectHouseList" parameterType="com.bonus.sgzb.base.domain.MaHouse" resultMap="SysHouseResult">
|
<select id="selectHouseList" parameterType="com.bonus.sgzb.base.domain.MaHouse" resultMap="SysHouseResult">
|
||||||
select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id, sort,concat,phone
|
select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, remark, company_id, sort,concat,phone
|
||||||
from ma_house_info
|
from ma_house_info
|
||||||
<where>
|
where del_flag = '0'
|
||||||
<if test="houseName != null and houseName != ''">
|
<if test="houseName != null and houseName != ''">
|
||||||
AND house_name like concat('%', #{houseName}, '%')
|
AND house_name like concat('%', #{houseName}, '%')
|
||||||
</if>
|
</if>
|
||||||
</where>
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectHouseById" parameterType="com.bonus.sgzb.base.domain.MaHouse" resultMap="SysHouseResult">
|
<select id="selectHouseById" parameterType="com.bonus.sgzb.base.domain.MaHouse" resultMap="SysHouseResult">
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
AND type_id = #{typeId}
|
AND type_id = #{typeId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by m.id desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||||
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
|
import com.bonus.sgzb.material.service.IPurchaseMacodeInfoService;
|
||||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||||
|
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -65,13 +66,24 @@ public class PurchaseMacodeInfoController extends BaseController
|
||||||
return success(purchaseMacodeInfoService.selectPurchaseMacodeInfo(purchaseMacodeInfo));
|
return success(purchaseMacodeInfoService.selectPurchaseMacodeInfo(purchaseMacodeInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取新购验收编号管理详细信息
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "新购入库清单明细")
|
||||||
|
@GetMapping(value = "/putinDetails")
|
||||||
|
public TableDataInfo putinDetails(PurchaseMacodeInfo purchaseMacodeInfo)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
return getDataTable(purchaseMacodeInfoService.selectPutinDetails(purchaseMacodeInfo));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新增新购验收编号管理
|
* 新增新购验收编号管理
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增新购验收编号管理")
|
@ApiOperation(value = "新增新购验收编号管理")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception {
|
public AjaxResult add(@RequestBody List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception {
|
||||||
return toAjax(purchaseMacodeInfoService.insertPurchaseMacodeInfo(purchaseMacodeInfoList));
|
return purchaseMacodeInfoService.insertPurchaseMacodeInfo(purchaseMacodeInfoList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -104,8 +116,8 @@ public class PurchaseMacodeInfoController extends BaseController
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改编码管理的入库状态")
|
@ApiOperation(value = "修改编码管理的入库状态")
|
||||||
@PutMapping("/manageStatus")
|
@PutMapping("/manageStatus")
|
||||||
public AjaxResult modifyManageStatus(@RequestBody MaInputRecord maInputRecord) throws Exception {
|
public AjaxResult modifyManageStatus(@RequestBody MaInputVO maInputVO) throws Exception {
|
||||||
return toAjax(purchaseMacodeInfoService.modifyManageStatus(maInputRecord));
|
return toAjax(purchaseMacodeInfoService.modifyManageStatus(maInputVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -20,39 +20,37 @@ public class MaInputRecord extends BaseEntity
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
/** $column.columnComment */
|
/** $column.columnComment */
|
||||||
|
@ApiModelProperty(value = "主键id")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 任务ID */
|
/** 任务ID */
|
||||||
@Excel(name = "任务ID")
|
@ApiModelProperty(value = "任务ID")
|
||||||
private Long taskId;
|
private Long taskId;
|
||||||
|
|
||||||
/** 类型ID */
|
/** 类型ID */
|
||||||
@Excel(name = "类型ID")
|
@ApiModelProperty(value = "类型ID")
|
||||||
private Long typeId;
|
private Long typeId;
|
||||||
|
|
||||||
/** 机具ID */
|
/** 机具ID */
|
||||||
@Excel(name = "机具ID")
|
@ApiModelProperty(value = "机具ID")
|
||||||
private Long maId;
|
private Long maId;
|
||||||
|
|
||||||
/** 入库类型(1新购入库,2退料入库,3修试后入库) */
|
/** 入库类型(1新购入库,2退料入库,3修试后入库) */
|
||||||
@Excel(name = "入库类型(1新购入库,2退料入库,3修试后入库)")
|
@ApiModelProperty(value = "入库类型(1新购入库,2退料入库,3修试后入库)")
|
||||||
private String inputType;
|
private String inputType;
|
||||||
|
|
||||||
/** 入库数量 */
|
/** 入库数量 */
|
||||||
@Excel(name = "入库数量")
|
@ApiModelProperty(value = "入库数量")
|
||||||
private BigDecimal inputNum;
|
private BigDecimal inputNum;
|
||||||
|
|
||||||
/** 状态(0删除,1正常) */
|
/** 状态(0删除,1正常) */
|
||||||
@Excel(name = "状态", readConverterExp = "0=删除,1正常")
|
@ApiModelProperty(value = "状态 0=删除,1正常")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 数据所属组织 */
|
/** 数据所属组织 */
|
||||||
@Excel(name = "数据所属组织")
|
@ApiModelProperty(value = "数据所属组织")
|
||||||
private Long companyId;
|
private Long companyId;
|
||||||
|
|
||||||
@ApiModelProperty("验收的编码id")
|
|
||||||
private List<Long> maCodeInfoIdList;
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "验收结论")
|
@ApiModelProperty(value = "验收结论")
|
||||||
private String checkResult;
|
private String checkResult;
|
||||||
|
|
||||||
|
|
@ -134,13 +132,6 @@ public class MaInputRecord extends BaseEntity
|
||||||
return companyId;
|
return companyId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Long> getMaCodeInfoIdList() {
|
|
||||||
return maCodeInfoIdList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMaCodeInfoIdList(List<Long> maCodeInfoIdList) {
|
|
||||||
this.maCodeInfoIdList = maCodeInfoIdList;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCheckResult() {
|
public String getCheckResult() {
|
||||||
return checkResult;
|
return checkResult;
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,12 @@ public class PurchaseCheckDetails extends BaseEntity
|
||||||
@ApiModelProperty(value = "规格型号")
|
@ApiModelProperty(value = "规格型号")
|
||||||
private String specificationType;
|
private String specificationType;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "规格型号")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "单位")
|
||||||
|
private String unitName;
|
||||||
|
|
||||||
@ApiModelProperty(value = "机具类型名称")
|
@ApiModelProperty(value = "机具类型名称")
|
||||||
private String machineTypeName;
|
private String machineTypeName;
|
||||||
|
|
||||||
|
|
@ -302,6 +308,22 @@ public class PurchaseCheckDetails extends BaseEntity
|
||||||
this.bindNum = bindNum;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,13 @@ public class PurchaseMacodeInfo extends BaseEntity
|
||||||
@ApiModelProperty(value = "出厂日期")
|
@ApiModelProperty(value = "出厂日期")
|
||||||
private Date productionTime;
|
private Date productionTime;
|
||||||
|
|
||||||
|
/** 到货日期 */
|
||||||
|
@ApiModelProperty(value = "到货日期")
|
||||||
|
private String arrivalTime;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "0,正常 1, 重复数据")
|
||||||
|
private int statusFlag;
|
||||||
|
|
||||||
public Long getId() {
|
public Long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
@ -278,6 +285,22 @@ public class PurchaseMacodeInfo extends BaseEntity
|
||||||
this.assetsCode = assetsCode;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.bonus.sgzb.material.domain.PurchaseCheckDetails;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -71,4 +72,10 @@ public interface PurchaseCheckDetailsMapper {
|
||||||
int deleteCheckDetailsByTaskId(Long taskId);
|
int deleteCheckDetailsByTaskId(Long taskId);
|
||||||
|
|
||||||
int updateByTaskIdTypeId(PurchaseCheckDetails purchaseCheckDetails);
|
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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,4 +96,10 @@ public interface PurchaseMacodeInfoMapper {
|
||||||
int deleteMaMachineInfoByMaCode(String maCode);
|
int deleteMaMachineInfoByMaCode(String maCode);
|
||||||
|
|
||||||
List<PurchaseMacodeInfo> selectPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo);
|
List<PurchaseMacodeInfo> selectPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||||
|
|
||||||
|
List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||||
|
|
||||||
|
int selectMaCode(String maCode);
|
||||||
|
|
||||||
|
int updateMacodeByType(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
package com.bonus.sgzb.material.service;
|
package com.bonus.sgzb.material.service;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
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.MaInputRecord;
|
||||||
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
import com.bonus.sgzb.material.domain.PurchaseMacodeInfo;
|
||||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||||
|
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
@ -37,7 +39,7 @@ public interface IPurchaseMacodeInfoService
|
||||||
* @param purchaseMacodeInfoList 新购验收编号管理purchase_macode_info
|
* @param purchaseMacodeInfoList 新购验收编号管理purchase_macode_info
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int insertPurchaseMacodeInfo(List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception;
|
public AjaxResult insertPurchaseMacodeInfo(List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改新购验收编号管理purchase_macode_info
|
* 修改新购验收编号管理purchase_macode_info
|
||||||
|
|
@ -67,9 +69,12 @@ public interface IPurchaseMacodeInfoService
|
||||||
|
|
||||||
int deletePurchaseMacodeInfoById(Long id);
|
int deletePurchaseMacodeInfoById(Long id);
|
||||||
|
|
||||||
int modifyManageStatus(MaInputRecord maInputRecord);
|
int modifyManageStatus(MaInputVO maInputVO);
|
||||||
|
|
||||||
int deletePurchaseMacodeInfoByMaCode(String maCode);
|
int deletePurchaseMacodeInfoByMaCode(String maCode);
|
||||||
|
|
||||||
List<PurchaseMacodeInfo> selectPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo);
|
List<PurchaseMacodeInfo> selectPurchaseMacodeInfo(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||||
|
|
||||||
|
List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ public class PurchaseCheckDetailsServiceImpl implements IPurchaseCheckDetailsSer
|
||||||
// macodeInfoService.insertPurchaseMacodeInfo(macodeInfo);
|
// macodeInfoService.insertPurchaseMacodeInfo(macodeInfo);
|
||||||
// }
|
// }
|
||||||
} else if ("不通过".equals(purchaseCheckDetails.getCheckResult())) {
|
} else if ("不通过".equals(purchaseCheckDetails.getCheckResult())) {
|
||||||
purchaseCheckDetails.setStatus(0);
|
purchaseCheckDetails.setStatus(3);
|
||||||
} else {
|
} else {
|
||||||
purchaseCheckDetails.setStatus(2);
|
purchaseCheckDetails.setStatus(2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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.MaType;
|
||||||
import com.bonus.sgzb.base.api.domain.TmTask;
|
import com.bonus.sgzb.base.api.domain.TmTask;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
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.BmQrcodeInfo;
|
||||||
import com.bonus.sgzb.material.domain.MaInputRecord;
|
import com.bonus.sgzb.material.domain.MaInputRecord;
|
||||||
import com.bonus.sgzb.material.domain.PurchaseCheckDetails;
|
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.material.service.IPurchaseMacodeInfoService;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
import com.bonus.sgzb.material.vo.EquipmentNumberVO;
|
||||||
|
import com.bonus.sgzb.material.vo.MaInputVO;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
@ -46,7 +49,6 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
private PurchaseCheckDetailsMapper checkDetailsMapper;
|
private PurchaseCheckDetailsMapper checkDetailsMapper;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询新购验收编号管理
|
* 查询新购验收编号管理
|
||||||
*
|
*
|
||||||
|
|
@ -76,10 +78,27 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int insertPurchaseMacodeInfo(List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception {
|
@Transactional
|
||||||
|
public AjaxResult insertPurchaseMacodeInfo(List<PurchaseMacodeInfo> 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) {
|
for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) {
|
||||||
Long typeId = purchaseMacodeInfo.getTypeId();
|
Long typeId = purchaseMacodeInfo.getTypeId();
|
||||||
String maCode = purchaseMacodeInfo.getMaCode();
|
String maCode = purchaseMacodeInfo.getMaCode();
|
||||||
|
purchaseCheckDetails.setTypeId(typeId);
|
||||||
|
purchaseCheckDetails.setTaskId(purchaseMacodeInfo.getTaskId());
|
||||||
if (StringUtils.isNotEmpty(maCode)) {
|
if (StringUtils.isNotEmpty(maCode)) {
|
||||||
MaMachine maMachine = new MaMachine();
|
MaMachine maMachine = new MaMachine();
|
||||||
maMachine.setTypeId(typeId);
|
maMachine.setTypeId(typeId);
|
||||||
|
|
@ -96,6 +115,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
}
|
}
|
||||||
maMachine.setMaCode(maCode);
|
maMachine.setMaCode(maCode);
|
||||||
maMachine.setCreateTime(new Date());
|
maMachine.setCreateTime(new Date());
|
||||||
|
maMachine.setCreateBy(SecurityUtils.getUsername());
|
||||||
purchaseMacodeInfoMapper.maMachineAdd(maMachine);
|
purchaseMacodeInfoMapper.maMachineAdd(maMachine);
|
||||||
}
|
}
|
||||||
String qrCode = purchaseMacodeInfo.getQrCode();
|
String qrCode = purchaseMacodeInfo.getQrCode();
|
||||||
|
|
@ -112,8 +132,12 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
purchaseMacodeInfo.setCreateTime(DateUtils.getNowDate());
|
purchaseMacodeInfo.setCreateTime(DateUtils.getNowDate());
|
||||||
purchaseMacodeInfoMapper.insertPurchaseMacodeInfo(purchaseMacodeInfo);
|
purchaseMacodeInfoMapper.insertPurchaseMacodeInfo(purchaseMacodeInfo);
|
||||||
}
|
}
|
||||||
|
Integer bindNum = checkDetailsMapper.selectBindNUmByTypeId(purchaseCheckDetails.getTypeId(), purchaseCheckDetails.getTaskId());
|
||||||
return 1;
|
// 添加绑定数量
|
||||||
|
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
|
@Override
|
||||||
public int updatePurchaseMacodeInfo(List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception {
|
public int updatePurchaseMacodeInfo(List<PurchaseMacodeInfo> purchaseMacodeInfoList) throws Exception {
|
||||||
|
|
||||||
for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) {
|
for (PurchaseMacodeInfo purchaseMacodeInfo : purchaseMacodeInfoList) {
|
||||||
|
|
||||||
Long typeId = purchaseMacodeInfo.getTypeId();
|
Long typeId = purchaseMacodeInfo.getTypeId();
|
||||||
String maCode = purchaseMacodeInfo.getMaCode();
|
String maCode = purchaseMacodeInfo.getMaCode();
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(maCode)) {
|
if (StringUtils.isNotEmpty(maCode)) {
|
||||||
MaMachine maMachine = new MaMachine();
|
MaMachine maMachine = new MaMachine();
|
||||||
maMachine.setTypeId(typeId);
|
maMachine.setTypeId(typeId);
|
||||||
|
|
@ -160,6 +186,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
purchaseMacodeInfo.setUpdateTime(DateUtils.getNowDate());
|
purchaseMacodeInfo.setUpdateTime(DateUtils.getNowDate());
|
||||||
purchaseMacodeInfoMapper.updatePurchaseMacodeInfo(purchaseMacodeInfo);
|
purchaseMacodeInfoMapper.updatePurchaseMacodeInfo(purchaseMacodeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -208,17 +235,17 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
for (int i = 0; i < equipmentNumberVO.getCount(); i++) {
|
for (int i = 0; i < equipmentNumberVO.getCount(); i++) {
|
||||||
int i1 = count + i;
|
int i1 = count + i;
|
||||||
// 编码规则
|
// 编码规则
|
||||||
String codingRule = "NXJJ" + typeCode + format + specsCode;
|
String codingRule = "NSJJ" + specsCode + format + typeCode;
|
||||||
String codeNum = "";
|
String codeNum = "";
|
||||||
String code = format;
|
String code = format;
|
||||||
String code1 = format;
|
String code1 = format;
|
||||||
if (i1>9 && i1<100){
|
if (i1 > 9 && i1 < 100) {
|
||||||
codeNum = "-00" + i1;
|
codeNum = "-00" + i1;
|
||||||
code1 = "-00" + i1;
|
code1 = "-00" + i1;
|
||||||
}else if (i1>99 && i1<1000){
|
} else if (i1 > 99 && i1 < 1000) {
|
||||||
codeNum = "-0" + i1;
|
codeNum = "-0" + i1;
|
||||||
code1 = "-0" + i1;
|
code1 = "-0" + i1;
|
||||||
}else {
|
} else {
|
||||||
codeNum = "-000" + i1;
|
codeNum = "-000" + i1;
|
||||||
code1 = "-000" + i1;
|
code1 = "-000" + i1;
|
||||||
}
|
}
|
||||||
|
|
@ -233,14 +260,15 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONObject result = new JSONObject();
|
JSONObject result = new JSONObject();
|
||||||
result.put("equipmentNum",list);
|
result.put("equipmentNum", list);
|
||||||
result.put("twoDimensionalCode",codeList);
|
result.put("twoDimensionalCode", codeList);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除机具编码
|
* 删除机具编码
|
||||||
|
*
|
||||||
* @param id 机具编码id
|
* @param id 机具编码id
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -251,52 +279,59 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改编码管理的入库状态
|
* 修改编码管理的入库状态
|
||||||
* @param maInputRecord 入库信息
|
*
|
||||||
|
* @param maInputVO 入库信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int modifyManageStatus(MaInputRecord maInputRecord) {
|
public int modifyManageStatus(MaInputVO maInputVO) {
|
||||||
Long taskId = maInputRecord.getTaskId();
|
Long taskId = maInputVO.getTaskId();
|
||||||
Long typeId = maInputRecord.getTypeId();
|
List<MaInputRecord> inputRecordList = maInputVO.getInputRecordList();
|
||||||
String checkResult = maInputRecord.getCheckResult();
|
for (MaInputRecord maInputRecord : inputRecordList) {
|
||||||
List<Long> maCodeInfoIdList = maInputRecord.getMaCodeInfoIdList();
|
Long typeId = maInputRecord.getTypeId();
|
||||||
// 修改编码管理的入库状态
|
String checkResult = maInputRecord.getCheckResult();
|
||||||
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);
|
|
||||||
|
|
||||||
// 修改机具入库状态
|
// 修改机具入库状态
|
||||||
MaMachine maMachine = new MaMachine();
|
MaMachine maMachine = new MaMachine();
|
||||||
maMachine.setMaId(maInputRecord.getMaId());
|
maMachine.setMaId(maInputRecord.getMaId());
|
||||||
maMachine.setMaCode(maInputRecord.getMaCode());
|
maMachine.setMaCode(maInputRecord.getMaCode());
|
||||||
maMachine.setMaStatus("15");
|
maMachine.setMaStatus("1".equals(checkResult) ? "15":"14");
|
||||||
purchaseMacodeInfoMapper.updateMaMachine(maMachine);
|
purchaseMacodeInfoMapper.updateMaMachine(maMachine);
|
||||||
|
|
||||||
// 修改验收任务详细表入库数量
|
// 修改验收任务详细表入库数量
|
||||||
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
|
if ("1".equals(checkResult)) {
|
||||||
purchaseCheckDetails.setTaskId(taskId);
|
// 修改编码管理的入库状态
|
||||||
purchaseCheckDetails.setTypeId(typeId);
|
MaType maType = purchaseMacodeInfoMapper.selectTypeByTypeId(typeId);
|
||||||
purchaseCheckDetails.setInputNum(maInputRecord.getInputNum());
|
// 库存添加
|
||||||
checkDetailsMapper.updateByTaskIdTypeId(purchaseCheckDetails);
|
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 purchaseMacodeInfo = new PurchaseMacodeInfo();
|
||||||
purchaseMacodeInfo.setId(maCodeInfoId);
|
|
||||||
purchaseMacodeInfo.setTaskId(taskId);
|
purchaseMacodeInfo.setTaskId(taskId);
|
||||||
purchaseMacodeInfo.setStatus("通过".equals(checkResult) ? "54":"55");
|
purchaseMacodeInfo.setTypeId(typeId);
|
||||||
purchaseMacodeInfoMapper.updatePurchaseMacodeInfo(purchaseMacodeInfo);
|
purchaseMacodeInfo.setStatus("1".equals(checkResult) ? "1" : "0");
|
||||||
|
purchaseMacodeInfoMapper.updateMacodeByType(purchaseMacodeInfo);
|
||||||
// 新增入库记录
|
// 新增入库记录
|
||||||
purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord);
|
purchaseMacodeInfoMapper.insertMaInputRecord(maInputRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// 当全部为已入库的时候任务改为入库状态
|
// 当全部为已入库的时候任务改为入库状态
|
||||||
Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
|
Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
TmTask task = new TmTask();
|
TmTask task = new TmTask();
|
||||||
task.setTaskId(taskId);
|
task.setTaskId(taskId);
|
||||||
task.setTaskStatus(54);
|
task.setTaskStatus(28);
|
||||||
taskMapper.updateTmTask(task);
|
taskMapper.updateTmTask(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,6 +340,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据机具编码删除编码
|
* 根据机具编码删除编码
|
||||||
|
*
|
||||||
* @param maCode 机具编码
|
* @param maCode 机具编码
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -317,6 +353,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据类型id和任务id查询编码详情
|
* 根据类型id和任务id查询编码详情
|
||||||
|
*
|
||||||
* @param purchaseMacodeInfo
|
* @param purchaseMacodeInfo
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
|
|
@ -325,4 +362,15 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
||||||
return purchaseMacodeInfoMapper.selectPurchaseMacodeInfo(purchaseMacodeInfo);
|
return purchaseMacodeInfoMapper.selectPurchaseMacodeInfo(purchaseMacodeInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取入库清单明细
|
||||||
|
*
|
||||||
|
* @param purchaseMacodeInfo 查询条件
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||||
|
return purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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<MaInputRecord> inputRecordList;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -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,
|
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.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,
|
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
|
from purchase_check_details pcd
|
||||||
left join ma_type mt on pcd.type_id = mt.type_id
|
left join ma_type mt on pcd.type_id = mt.type_id
|
||||||
left join ma_type mt1 on mt.parent_id = mt1.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"
|
||||||
<select id="selectPurchaseCheckDetailsStatus" resultType="int">
|
<select id="selectPurchaseCheckDetailsStatus" resultType="int">
|
||||||
select count(*) from purchase_check_details where task_id = #{taskId} and status != 1
|
select count(*) from purchase_check_details where task_id = #{taskId} and status != 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectInputNUmByTypeId" resultType="java.math.BigDecimal">
|
||||||
|
select IFNULL(input_num,0) from purchase_check_details where task_id = #{taskId} and type_id = #{typeId}
|
||||||
|
</select>
|
||||||
|
<select id="selectBindNUmByTypeId" resultType="java.lang.Integer">
|
||||||
|
select IFNULL(bind_num, 0) from purchase_check_details where task_id = #{taskId} and type_id = #{typeId}
|
||||||
|
</select>
|
||||||
|
|
||||||
<delete id="deleteCheckDetailsByTaskId">
|
<delete id="deleteCheckDetailsByTaskId">
|
||||||
delete from purchase_check_details where task_id = #{taskId}
|
delete from purchase_check_details where task_id = #{taskId}
|
||||||
|
|
@ -204,4 +211,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateByTaskIdTypeId">
|
<update id="updateByTaskIdTypeId">
|
||||||
update purchase_check_details set check_num = #{checkNum} where task_id = #{taskId} and type_id = #{typeId}
|
update purchase_check_details set check_num = #{checkNum} where task_id = #{taskId} and type_id = #{typeId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateCheckDetails">
|
||||||
|
update purchase_check_details set status = '0' where task_id = #{taskId}
|
||||||
|
</update>
|
||||||
|
<update id="updateBindByTaskIdTypeId">
|
||||||
|
update purchase_check_details set bind_num = #{bindNum} where task_id = #{taskId} and type_id = #{typeId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -154,5 +154,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
|
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if>
|
||||||
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
|
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if>
|
||||||
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
|
<if test="companyId != null "> and pci.company_id = #{companyId}</if>
|
||||||
|
order by pci.id desc
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo" resultMap="PurchaseMacodeInfoResult">
|
<select id="selectPurchaseMacodeInfoList" parameterType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo" resultMap="PurchaseMacodeInfoResult">
|
||||||
select distinct pcd.task_id, pcd.type_id, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status,
|
select distinct pcd.task_id, pcd.type_id, pmi.qr_code, pmi.fix_code, pmi.code_type, pmi.status,
|
||||||
pmi.remark, pmi.company_id, mt.type_name specificationType,
|
pmi.remark, pmi.company_id, mt.type_name specificationType, pt.arrival_time arrivalTime,
|
||||||
mt1.type_name typeName, pcd.check_num checkNum, pcd.purchase_num purchaseNum ,
|
mt1.type_name typeName, pcd.check_num checkNum, pcd.purchase_num purchaseNum ,
|
||||||
IFNULL(pcd.bind_num,0) bindNum, mt.code typeCode,mt.model_code specsCode,pt.purchase_time purchaseTime
|
IFNULL(pcd.bind_num,0) bindNum, mt.code typeCode,mt.model_code specsCode,pt.purchase_time purchaseTime
|
||||||
from purchase_check_details pcd
|
from purchase_check_details pcd
|
||||||
|
|
@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
|
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id
|
||||||
left join purchase_check_info pt on pcd.task_id = pt.task_id
|
left join purchase_check_info pt on pcd.task_id = pt.task_id
|
||||||
where pcd.task_id = #{taskId}
|
where pcd.task_id = #{taskId}
|
||||||
|
and mt.manage_type = '0'
|
||||||
<if test="typeId != null "> and pmi.type_id = #{typeId}</if>
|
<if test="typeId != null "> and pmi.type_id = #{typeId}</if>
|
||||||
<if test="keyWord != null and keyWord != ''">(mt.type_name like concat('%',#{keyWord},'%') or mt1.type_name like concat('%',#{keyWord})</if>
|
<if test="keyWord != null and keyWord != ''">(mt.type_name like concat('%',#{keyWord},'%') or mt1.type_name like concat('%',#{keyWord})</if>
|
||||||
<if test="typeName != null and typeName != ''"> and mt1.type_name = #{typeName}</if>
|
<if test="typeName != null and typeName != ''"> and mt1.type_name = #{typeName}</if>
|
||||||
|
|
@ -200,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
|
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
|
||||||
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'
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<insert id="insertMaInputRecord" parameterType="com.bonus.sgzb.material.domain.MaInputRecord" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertMaInputRecord" parameterType="com.bonus.sgzb.material.domain.MaInputRecord" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
|
@ -256,6 +257,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="productionTime != null">pcd.production_time = #{productionTime}</if>
|
<if test="productionTime != null">pcd.production_time = #{productionTime}</if>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectPutinDetails" resultType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo">
|
||||||
|
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>
|
||||||
|
<select id="selectMaCode" resultType="java.lang.Integer">
|
||||||
|
select count(ma_id) from ma_machine where ma_code = #{maCode}
|
||||||
|
</select>
|
||||||
|
|
||||||
<update id="updateTypeByTypeId">
|
<update id="updateTypeByTypeId">
|
||||||
update ma_type set num = #{num} where type_id = #{typeId}
|
update ma_type set num = #{num} where type_id = #{typeId}
|
||||||
|
|
@ -264,4 +280,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<update id="updateMaMachine">
|
<update id="updateMaMachine">
|
||||||
update ma_machine set ma_status = #{maStatus} where ma_id = #{maId}
|
update ma_machine set ma_status = #{maStatus} where ma_id = #{maId}
|
||||||
</update>
|
</update>
|
||||||
|
<update id="updateMacodeByType">
|
||||||
|
update purchase_macode_info set status = #{status} where task_id = #{taskId} and type_id = #{typeId}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.system.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -53,9 +54,9 @@ public class PurchaseNoticePersonController extends BaseController
|
||||||
@ApiOperation(value ="新增新购短信通知人员")
|
@ApiOperation(value ="新增新购短信通知人员")
|
||||||
@Log(title = "新购短信通知人员", businessType = BusinessType.INSERT)
|
@Log(title = "新购短信通知人员", businessType = BusinessType.INSERT)
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public AjaxResult add(@RequestBody PurchaseNoticePerson purchaseNoticePerson)
|
public AjaxResult add(@RequestBody List<PurchaseNoticePerson> purchaseNoticePersonList)
|
||||||
{
|
{
|
||||||
return toAjax(purchaseNoticePersonService.insertPurchaseNoticePerson(purchaseNoticePerson));
|
return toAjax(purchaseNoticePersonService.insertPurchaseNoticePersonList(purchaseNoticePersonList));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -63,9 +64,20 @@ public class PurchaseNoticePersonController extends BaseController
|
||||||
*/
|
*/
|
||||||
@RequiresPermissions("删除新购短信通知人员")
|
@RequiresPermissions("删除新购短信通知人员")
|
||||||
@Log(title = "删除新购短信通知人员", businessType = BusinessType.DELETE)
|
@Log(title = "删除新购短信通知人员", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{id}")
|
@DeleteMapping("/{userId}")
|
||||||
public AjaxResult remove(@PathVariable Long id)
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.sgzb.system.mapper;
|
package com.bonus.sgzb.system.mapper;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
|
@ -48,10 +50,10 @@ public interface PurchaseNoticePersonMapper
|
||||||
/**
|
/**
|
||||||
* 删除新购短信通知人员purchase_notice_person
|
* 删除新购短信通知人员purchase_notice_person
|
||||||
*
|
*
|
||||||
* @param id 新购短信通知人员purchase_notice_person主键
|
* @param userId 新购短信通知人员purchase_notice_person主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseNoticePersonById(Long id);
|
public int deletePurchaseNoticePersonById(Long userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量删除新购短信通知人员purchase_notice_person
|
* 批量删除新购短信通知人员purchase_notice_person
|
||||||
|
|
@ -60,4 +62,6 @@ public interface PurchaseNoticePersonMapper
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseNoticePersonByIds(Long[] ids);
|
public int deletePurchaseNoticePersonByIds(Long[] ids);
|
||||||
|
|
||||||
|
List<PurchaseNoticePerson> getUserByRoleList(SysUser sysUser);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.sgzb.system.service;
|
package com.bonus.sgzb.system.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
import com.bonus.sgzb.system.domain.PurchaseNoticePerson;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -54,8 +56,13 @@ public interface IPurchaseNoticePersonService
|
||||||
/**
|
/**
|
||||||
* 删除新购短信通知人员purchase_notice_person信息
|
* 删除新购短信通知人员purchase_notice_person信息
|
||||||
*
|
*
|
||||||
* @param id 新购短信通知人员purchase_notice_person主键
|
* @param userId 新购短信通知人员purchase_notice_person主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
public int deletePurchaseNoticePersonById(Long id);
|
public int deletePurchaseNoticePersonById(Long userId);
|
||||||
|
|
||||||
|
List<PurchaseNoticePerson> getUserByRoleList(SysUser sysUser);
|
||||||
|
|
||||||
|
int insertPurchaseNoticePersonList(List<PurchaseNoticePerson> purchaseNoticePersonList);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
package com.bonus.sgzb.system.service.impl;
|
package com.bonus.sgzb.system.service.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.bonus.sgzb.system.api.domain.SysUser;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper;
|
import com.bonus.sgzb.system.mapper.PurchaseNoticePersonMapper;
|
||||||
|
|
@ -84,12 +86,35 @@ public class PurchaseNoticePersonServiceImpl implements IPurchaseNoticePersonSer
|
||||||
/**
|
/**
|
||||||
* 删除新购短信通知人员purchase_notice_person信息
|
* 删除新购短信通知人员purchase_notice_person信息
|
||||||
*
|
*
|
||||||
* @param id 新购短信通知人员purchase_notice_person主键
|
* @param userId 新购短信通知人员purchase_notice_person主键
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@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<PurchaseNoticePerson> getUserByRoleList(SysUser sysUser) {
|
||||||
|
return purchaseNoticePersonMapper.getUserByRoleList(sysUser);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量添加人员
|
||||||
|
* @param purchaseNoticePersonList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertPurchaseNoticePersonList(List<PurchaseNoticePerson> purchaseNoticePersonList) {
|
||||||
|
for (PurchaseNoticePerson purchaseNoticePerson : purchaseNoticePersonList) {
|
||||||
|
insertPurchaseNoticePerson(purchaseNoticePerson);
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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 d on u.dept_id = d.dept_id
|
||||||
left join sys_dept d1 on d.parent_id = d1.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
|
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'
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
@ -32,17 +32,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<include refid="selectPurchaseNoticePersonVo"/>
|
<include refid="selectPurchaseNoticePersonVo"/>
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getUserByRoleList" resultType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
||||||
|
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)
|
||||||
|
</select>
|
||||||
|
|
||||||
<insert id="insertPurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
<insert id="insertPurchaseNoticePerson" parameterType="com.bonus.sgzb.system.domain.PurchaseNoticePerson">
|
||||||
insert into purchase_notice_person
|
insert into purchase_notice_person
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">id,</if>
|
|
||||||
<if test="userId != null">user_id,</if>
|
<if test="userId != null">user_id,</if>
|
||||||
<if test="userName != null">user_name,</if>
|
<if test="userName != null">user_name,</if>
|
||||||
<if test="telphone != null">telphone,</if>
|
<if test="telphone != null">telphone,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="id != null">#{id},</if>
|
|
||||||
<if test="userId != null">#{userId},</if>
|
<if test="userId != null">#{userId},</if>
|
||||||
<if test="userName != null">#{userName},</if>
|
<if test="userName != null">#{userName},</if>
|
||||||
<if test="telphone != null">#{telphone},</if>
|
<if test="telphone != null">#{telphone},</if>
|
||||||
|
|
@ -60,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<delete id="deletePurchaseNoticePersonById" parameterType="Long">
|
<delete id="deletePurchaseNoticePersonById" parameterType="Long">
|
||||||
delete from purchase_notice_person where id = #{id}
|
delete from purchase_notice_person where user_id = #{userId}
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<delete id="deletePurchaseNoticePersonByIds" parameterType="String">
|
<delete id="deletePurchaseNoticePersonByIds" parameterType="String">
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
u.remark
|
u.remark
|
||||||
from sys_user u
|
from sys_user u
|
||||||
left join sys_user_role sur on u.user_id = sur.user_id
|
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'
|
||||||
|
<if test="roleId != null" >
|
||||||
|
and sur.role_id = #{roleId}
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue