新购驳回
This commit is contained in:
parent
e900a0c3fe
commit
2886d4946b
|
|
@ -53,6 +53,17 @@ public class PurchaseAccessoryController extends BaseController
|
|||
return success(purchaseAccessoryService.selectPurchasePartInfoByTaskId(taskId,keyWord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新购配件验收单
|
||||
*/
|
||||
@ApiOperation("获取新购配件验收单")
|
||||
@GetMapping(value = "/getAcceptanceForm")
|
||||
public AjaxResult getAcceptanceForm(@RequestParam(required = false) Long taskId,
|
||||
@RequestParam(required = false) String keyWord)
|
||||
{
|
||||
return success(purchaseAccessoryService.getAcceptanceForm(taskId,keyWord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新购配件任务
|
||||
*/
|
||||
|
|
@ -144,6 +155,16 @@ public class PurchaseAccessoryController extends BaseController
|
|||
return getDataTable(purchaseAccessoryService.selectPutinDetails(purchasePartDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新购配件入库单
|
||||
*/
|
||||
@ApiOperation(value = "获取新购配件入库单")
|
||||
@GetMapping(value = "/warehousingEntry")
|
||||
public AjaxResult warehousingEntry(PurchasePartDetails purchasePartDetails)
|
||||
{
|
||||
return success(purchaseAccessoryService.warehousingEntry(purchasePartDetails));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购配件入库审核
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -92,6 +92,17 @@ public class PurchaseCheckInfoController extends BaseController
|
|||
return success(purchaseCheckInfoService.selectPurchaseCheckInfoByTaskId(taskId,keyWord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新购验收任务--验收单
|
||||
*/
|
||||
@ApiOperation("获取新购验收任务验收单")
|
||||
@GetMapping(value = "/getAcceptanceForm")
|
||||
public AjaxResult getAcceptanceForm(@RequestParam(required = false) Long taskId,
|
||||
@RequestParam(required = false) String keyWord)
|
||||
{
|
||||
return success(purchaseCheckInfoService.getAcceptanceForm(taskId,keyWord));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增新购验收任务
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -78,13 +78,13 @@ public class PurchaseMacodeInfoController extends BaseController
|
|||
}
|
||||
|
||||
/**
|
||||
* 获取新购验收编号管理详细信息--用于入库单,不带分页
|
||||
* 获取新购入库单
|
||||
*/
|
||||
@ApiOperation(value = "入库单")
|
||||
@GetMapping(value = "/warehousingEntry")
|
||||
public AjaxResult warehousingEntry(PurchaseMacodeInfo purchaseMacodeInfo)
|
||||
{
|
||||
return success(purchaseMacodeInfoService.selectPutinDetails(purchaseMacodeInfo));
|
||||
return success(purchaseMacodeInfoService.warehousingEntry(purchaseMacodeInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -89,6 +89,9 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "关键字筛选")
|
||||
private String keyWord;
|
||||
|
||||
@ApiModelProperty(value = "关键字筛选")
|
||||
private String dictName;
|
||||
|
||||
@ApiModelProperty(value = "规格编码")
|
||||
private String specsCode;
|
||||
|
||||
|
|
@ -313,6 +316,14 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
this.rfidCode = rfidCode;
|
||||
}
|
||||
|
||||
public String getDictName() {
|
||||
return dictName;
|
||||
}
|
||||
|
||||
public void setDictName(String dictName) {
|
||||
this.dictName = dictName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -33,8 +33,16 @@ public class PurchasePartDetails extends BaseEntity
|
|||
|
||||
/** 规格id */
|
||||
@ApiModelProperty(value = "规格id")
|
||||
private Long typeId;
|
||||
|
||||
/** 规格id */
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Long modelId;
|
||||
|
||||
/** 规格id */
|
||||
@ApiModelProperty(value = "类型id")
|
||||
private Long deviceTypeId;
|
||||
|
||||
@ApiModelProperty(value = "采购单号")
|
||||
@Excel(name = "采购单号")
|
||||
private String code;
|
||||
|
|
@ -432,6 +440,22 @@ public class PurchasePartDetails extends BaseEntity
|
|||
this.purchaserName = purchaserName;
|
||||
}
|
||||
|
||||
public Long getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(Long typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public Long getDeviceTypeId() {
|
||||
return deviceTypeId;
|
||||
}
|
||||
|
||||
public void setDeviceTypeId(Long deviceTypeId) {
|
||||
this.deviceTypeId = deviceTypeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
|
|
|
|||
|
|
@ -38,28 +38,29 @@ public interface PurchaseAccessoryMapper
|
|||
/**
|
||||
*查询新购配件任务验收列表
|
||||
* @param purchasePartInfo
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
List<PurchasePartInfo> selectPurchasePartInfoList(PurchasePartInfo purchasePartInfo);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param taskId
|
||||
* @return
|
||||
* @param type
|
||||
* @return String
|
||||
*/
|
||||
String selectTypeNameByTaskId(Long taskId);
|
||||
String selectTypeNameByTaskId(@Param("taskId") Long taskId,@Param("type") String type);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param taskId
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
PurchasePartInfo selectPurchasePartInfoByTaskId(Long taskId);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param purchasePartDetails
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
List<PurchasePartDetails> selectPurchasePartDetailsList(PurchasePartDetails purchasePartDetails);
|
||||
|
||||
|
|
@ -94,17 +95,16 @@ public interface PurchaseAccessoryMapper
|
|||
/**
|
||||
* 修改
|
||||
* @param purchasePartDetails
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
int updatePurchasePartDetails(PurchasePartDetails purchasePartDetails);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param taskId
|
||||
* @param status
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
int selectPurchasePartDetailsStatus(@Param("taskId") Long taskId,@Param("status") int status);
|
||||
int selectPurchasePartDetailsStatus(@Param("taskId") Long taskId);
|
||||
|
||||
/**
|
||||
* 获取配件信息
|
||||
|
|
@ -116,7 +116,7 @@ public interface PurchaseAccessoryMapper
|
|||
/**
|
||||
* 查询
|
||||
* @param purchasePartDetails
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
List<PurchasePartDetails> selectPutinDetails(PurchasePartDetails purchasePartDetails);
|
||||
|
||||
|
|
@ -124,14 +124,14 @@ public interface PurchaseAccessoryMapper
|
|||
* 修改
|
||||
* @param partId
|
||||
* @param inputNum
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
int updatePartTypeNum(@Param("partId") Long partId,@Param("inputNum") BigDecimal inputNum);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* @param id
|
||||
* @return
|
||||
* @return 结果
|
||||
*/
|
||||
int setlectStatusById(Long id);
|
||||
|
||||
|
|
@ -148,4 +148,32 @@ public interface PurchaseAccessoryMapper
|
|||
* @return List<PurchasePartInfo>
|
||||
*/
|
||||
List<PurchasePartDetails> inputExport(PurchasePartDetails bean);
|
||||
|
||||
/**
|
||||
* 判断是否全部已操作(不通过或通过)
|
||||
* @param taskId
|
||||
* @return int
|
||||
*/
|
||||
int isOperateAll(Long taskId);
|
||||
|
||||
/**
|
||||
* 是否为全部不通过
|
||||
* @param taskId
|
||||
* @return 结果
|
||||
*/
|
||||
int selectPurchasePartDetailsStatusIsNoPass(Long taskId);
|
||||
|
||||
/**
|
||||
* 新购验收单
|
||||
* @param purchasePartDetails
|
||||
* @return 结果
|
||||
*/
|
||||
List<PurchasePartDetails> getAcceptanceForm(PurchasePartDetails purchasePartDetails);
|
||||
|
||||
/**
|
||||
* 新购入库单
|
||||
* @param purchasePartDetails
|
||||
* @return 结果
|
||||
*/
|
||||
List<PurchasePartDetails> warehousingEntry(PurchasePartDetails purchasePartDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,4 +135,11 @@ public interface PurchaseCheckDetailsMapper {
|
|||
* @return int
|
||||
*/
|
||||
int updatePurchaseCheckDetailsByTaskId(@Param("taskId") Long taskId,@Param("typeId") Long typeId);
|
||||
|
||||
/**
|
||||
* 新购验收单
|
||||
* @param purchaseCheckDetails
|
||||
* @return List<PurchaseCheckDetails>
|
||||
*/
|
||||
List<PurchaseCheckDetails> getAcceptanceForm(PurchaseCheckDetails purchaseCheckDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,4 +255,11 @@ public interface PurchaseMacodeInfoMapper {
|
|||
* @return int
|
||||
*/
|
||||
int deleteMaLabelBindByMaId(Long maId);
|
||||
|
||||
/**
|
||||
* 新购入库单
|
||||
* @param purchaseMacodeInfo
|
||||
* @return List<PurchaseMacodeInfo>
|
||||
*/
|
||||
List<PurchaseMacodeInfo> warehousingEntry(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,4 +101,19 @@ public interface IPurchaseAccessoryService
|
|||
* @return List<PurchasePartDetails>
|
||||
*/
|
||||
List<PurchasePartDetails> inputExport(PurchasePartDetails bean);
|
||||
|
||||
/**
|
||||
* 新购配件验收单
|
||||
* @param taskId
|
||||
* @param keyWord
|
||||
* @return 结果
|
||||
*/
|
||||
PurchasePartInfo getAcceptanceForm(Long taskId, String keyWord);
|
||||
|
||||
/**
|
||||
* 新购配件入库单
|
||||
* @param purchasePartDetails
|
||||
* @return 结果
|
||||
*/
|
||||
List<PurchasePartDetails> warehousingEntry(PurchasePartDetails purchasePartDetails);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,11 @@ public interface IPurchaseCheckInfoService
|
|||
* @return
|
||||
*/
|
||||
List<PurchaseInput> putInExportList(PurchaseCheckInfo purchaseCheckInfo);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
PurchaseCheckInfo getAcceptanceForm(Long taskId, String keyWord);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,4 +106,10 @@ public interface IPurchaseMacodeInfoService
|
|||
*/
|
||||
List<PurchaseMacodeInfo> selectPutinDetails(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||
|
||||
/**
|
||||
* 新购入库单
|
||||
* @param purchaseMacodeInfo
|
||||
* @return List<PurchaseMacodeInfo>
|
||||
*/
|
||||
List<PurchaseMacodeInfo> warehousingEntry(PurchaseMacodeInfo purchaseMacodeInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
public List<PurchasePartInfo> selectPurchasePartInfoList(PurchasePartInfo purchasePartInfo) {
|
||||
List<PurchasePartInfo> purchasePartInfos = purchaseAccessoryMapper.selectPurchasePartInfoList(purchasePartInfo);
|
||||
for (PurchasePartInfo partInfo : purchasePartInfos) {
|
||||
String typeName = purchaseAccessoryMapper.selectTypeNameByTaskId(partInfo.getTaskId());
|
||||
String typeName = purchaseAccessoryMapper.selectTypeNameByTaskId(partInfo.getTaskId(),"1");
|
||||
partInfo.setPurchasingTypeName(typeName);
|
||||
}
|
||||
return purchasePartInfos;
|
||||
|
|
@ -170,7 +170,7 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
public List<PurchasePartInfo> selectPutInListList(PurchasePartInfo purchasePartInfo) {
|
||||
List<PurchasePartInfo> purchasePartInfos = purchaseAccessoryMapper.selectPutInListList(purchasePartInfo);
|
||||
for (PurchasePartInfo partInfo : purchasePartInfos) {
|
||||
String typeName = purchaseAccessoryMapper.selectTypeNameByTaskId(partInfo.getTaskId());
|
||||
String typeName = purchaseAccessoryMapper.selectTypeNameByTaskId(partInfo.getTaskId(),"2");
|
||||
partInfo.setPurchasingTypeName(typeName);
|
||||
}
|
||||
return purchasePartInfos;
|
||||
|
|
@ -197,18 +197,27 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
throw new RuntimeException("验收失败,修改状态未成功");
|
||||
}
|
||||
}
|
||||
// 当全部为已验收,修改任务验收状态
|
||||
int status = 1;
|
||||
int count = purchaseAccessoryMapper.selectPurchasePartDetailsStatus(taskId, status);
|
||||
//判断是否全部已操作(不通过或通过)
|
||||
int count=purchaseAccessoryMapper.isOperateAll(taskId);
|
||||
if (count<=0){
|
||||
//是否为全部不通过
|
||||
int count1 = purchaseAccessoryMapper.selectPurchasePartDetailsStatusIsNoPass(taskId);
|
||||
if (count1<=0){
|
||||
//是则将任务状态改为验收不通过
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(71);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
taskMapper.updateTmTask(task);
|
||||
}else {
|
||||
// 当全部操作,修改任务为验收状态
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(69);
|
||||
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
task.setUpdateTime(DateUtils.getNowDate());
|
||||
res = taskMapper.updateTmTask(task);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("验收失败,修改任务状态未成功");
|
||||
taskMapper.updateTmTask(task);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
|
@ -224,6 +233,16 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
|
||||
@Override
|
||||
public List<PurchasePartDetails> selectPutinDetails(PurchasePartDetails purchasePartDetails) {
|
||||
//因传入status=0时在SQL中处理有问题所以在此处理
|
||||
if (purchasePartDetails.getStatus()!=null){
|
||||
if (purchasePartDetails.getStatus()==0){
|
||||
purchasePartDetails.setStatus(1);
|
||||
}else if (purchasePartDetails.getStatus()==1){
|
||||
purchasePartDetails.setStatus(3);
|
||||
}else if (purchasePartDetails.getStatus()==2){
|
||||
purchasePartDetails.setStatus(4);
|
||||
}
|
||||
}
|
||||
return purchaseAccessoryMapper.selectPutinDetails(purchasePartDetails);
|
||||
}
|
||||
|
||||
|
|
@ -235,7 +254,7 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
Long taskId = 0L;
|
||||
for (PurchasePartDetails partDetails : purchasePartDetailsList) {
|
||||
taskId = partDetails.getTaskId();
|
||||
//暂时只处理审核通过的
|
||||
//处理审核通过的
|
||||
if ("1".equals(partDetails.getCheckResult())) {
|
||||
partDetails.setStatus(3);
|
||||
partDetails.setInputNum(partDetails.getCheckNum());
|
||||
|
|
@ -245,7 +264,7 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
partDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
//查询该任务是否已审核
|
||||
res = purchaseAccessoryMapper.setlectStatusById(partDetails.getId());
|
||||
if (res > 0) {
|
||||
if (res <= 0) {
|
||||
res = purchaseAccessoryMapper.updatePurchasePartDetails(partDetails);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("审核入库失败,修改状态未成功");
|
||||
|
|
@ -254,17 +273,24 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
if (res == 0) {
|
||||
throw new RuntimeException("审核入库失败,修改配件库存未成功");
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
res = 1;
|
||||
partDetails.setStatus(4);
|
||||
partDetails.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
|
||||
partDetails.setUpdateTime(DateUtils.getNowDate());
|
||||
//查询该任务是否已审核
|
||||
res = purchaseAccessoryMapper.setlectStatusById(partDetails.getId());
|
||||
if (res <= 0) {
|
||||
res = purchaseAccessoryMapper.updatePurchasePartDetails(partDetails);
|
||||
if (res == 0) {
|
||||
throw new RuntimeException("审核入库失败,修改状态未成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 当全部审核通过,修改任务入库状态
|
||||
int status = 3;
|
||||
int count = purchaseAccessoryMapper.selectPurchasePartDetailsStatus(taskId, status);
|
||||
// 当全部审核,修改任务入库状态
|
||||
int count = purchaseAccessoryMapper.selectPurchasePartDetailsStatus(taskId);
|
||||
if (count <= 0) {
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
|
|
@ -292,6 +318,22 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
return purchaseAccessoryMapper.inputExport(bean);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PurchasePartInfo getAcceptanceForm(Long taskId, String keyWord) {
|
||||
PurchasePartInfo purchasePartInfo = purchaseAccessoryMapper.selectPurchasePartInfoByTaskId(taskId);
|
||||
PurchasePartDetails purchasePartDetails = new PurchasePartDetails();
|
||||
purchasePartDetails.setTaskId(purchasePartInfo.getTaskId());
|
||||
purchasePartDetails.setKeyWord(keyWord);
|
||||
List<PurchasePartDetails> purchasePartDetailsList = purchaseAccessoryMapper.getAcceptanceForm(purchasePartDetails);
|
||||
purchasePartInfo.setPartDetailsList(purchasePartDetailsList);
|
||||
return purchasePartInfo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchasePartDetails> warehousingEntry(PurchasePartDetails purchasePartDetails) {
|
||||
return purchaseAccessoryMapper.warehousingEntry(purchasePartDetails);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购配件--采购单号编码生成规则
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -83,6 +83,20 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
return purchaseCheckInfoMapper.putInExportList(purchaseCheckInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新购验收单
|
||||
*/
|
||||
@Override
|
||||
public PurchaseCheckInfo getAcceptanceForm(Long taskId, String keyword) {
|
||||
PurchaseCheckInfo purchaseCheckInfo = purchaseCheckInfoMapper.selectPurchaseCheckInfoByTaskId(taskId);
|
||||
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
|
||||
purchaseCheckDetails.setTaskId(purchaseCheckInfo.getTaskId());
|
||||
purchaseCheckDetails.setKeyWord(keyword);
|
||||
List<PurchaseCheckDetails> purchaseCheckDetailsList = purchaseCheckDetailsMapper.getAcceptanceForm(purchaseCheckDetails);
|
||||
purchaseCheckInfo.setCheckDetailsList(purchaseCheckDetailsList);
|
||||
return purchaseCheckInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询新购验收任务列表
|
||||
*
|
||||
|
|
|
|||
|
|
@ -339,7 +339,7 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
}
|
||||
}
|
||||
|
||||
// 当全部为已入库的时候任务改为入库状态
|
||||
// 当全部审核的时候任务改为入库状态
|
||||
Integer count = purchaseMacodeInfoMapper.selectMacodeInfoStatusByTaskId(taskId);
|
||||
if (count <= 0) {
|
||||
TmTask task = new TmTask();
|
||||
|
|
@ -389,4 +389,9 @@ public class PurchaseMacodeInfoServiceImpl implements IPurchaseMacodeInfoService
|
|||
return purchaseMacodeInfoMapper.selectPutinDetails(purchaseMacodeInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PurchaseMacodeInfo> warehousingEntry(PurchaseMacodeInfo purchaseMacodeInfo) {
|
||||
return purchaseMacodeInfoMapper.warehousingEntry(purchaseMacodeInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
purchase_part_details
|
||||
WHERE
|
||||
id=#{id}
|
||||
and `status`='1'
|
||||
and (`status`='3' or `status`='4')
|
||||
</select>
|
||||
|
||||
<delete id="deletePartDetailsByTaskId">
|
||||
|
|
@ -221,6 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_part_type mpt on ppd.part_id = mpt.pa_id
|
||||
left join ma_part_type mpt1 on mpt.parent_id = mpt1.pa_id
|
||||
where ppd.task_id = #{taskId}
|
||||
<if test="type == 2">and ppd.`status`!=2</if>
|
||||
) t
|
||||
GROUP BY task_id
|
||||
</select>
|
||||
|
|
@ -240,6 +241,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHEN pcd.`status` = 1 THEN '已验收'
|
||||
WHEN pcd.`status` = 2 THEN '验收不通过'
|
||||
WHEN pcd.`status` = 3 THEN '已入库'
|
||||
WHEN pcd.`status` = 4 THEN '入库不通过'
|
||||
ELSE ''
|
||||
END AS statusResult,
|
||||
pcd.supplier_id, msi.supplier, pcd.create_by, pcd.production_time, pcd.create_time,
|
||||
|
|
@ -293,7 +295,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
order by create_time desc
|
||||
</select>
|
||||
<select id="selectPurchasePartDetailsStatus" resultType="java.lang.Integer">
|
||||
select count(*) from purchase_part_details where task_id = #{taskId} and status != #{status}
|
||||
select count(*) from purchase_part_details where task_id = #{taskId} and status ='1'
|
||||
</select>
|
||||
<select id="getPartList" resultType="com.bonus.sgzb.material.domain.PurchasePartInfo">
|
||||
SELECT
|
||||
|
|
@ -318,6 +320,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHEN pcd.`status` = 1 THEN '待入库'
|
||||
WHEN pcd.`status` = 2 THEN '验收不通过'
|
||||
WHEN pcd.`status` = 3 THEN '已入库'
|
||||
WHEN pcd.`status` = 4 THEN '入库不通过'
|
||||
ELSE ''
|
||||
END AS statusResult,
|
||||
|
||||
|
|
@ -341,15 +344,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
LEFT JOIN tm_task tt on tt.task_id = pcd.task_id
|
||||
LEFT JOIN sys_user us on us.user_id = tt.update_by
|
||||
WHERE pcd.task_id = #{taskId}
|
||||
and pcd.`status`!=2
|
||||
<if test="keyWord != null and keyWord != ''">
|
||||
and (mt.pa_name like concat('%',#{keyWord},'%') or
|
||||
mt1.pa_name like concat('%',#{keyWord},'%'))
|
||||
</if>
|
||||
<if test="modelId != null and modelId != ''">
|
||||
and mt1.pa_id = #{modelId}
|
||||
<if test="deviceTypeId != null and deviceTypeId != ''">
|
||||
and mt1.pa_id = #{deviceTypeId}
|
||||
</if>
|
||||
<if test="partId != null and partId != ''">
|
||||
and mt.pa_id = #{partId}
|
||||
<if test="typeId != null and typeId != ''">
|
||||
and mt.pa_id = #{typeId}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND pcd.`status` = #{status}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
|
@ -419,4 +426,88 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="partId != null and partId != ''"> and mpt2.pa_id in (#{partId})</if>
|
||||
ORDER BY tk.task_id DESC
|
||||
</select>
|
||||
<select id="isOperateAll" resultType="java.lang.Integer">
|
||||
SELECT
|
||||
count(*)
|
||||
FROM
|
||||
purchase_part_details
|
||||
WHERE
|
||||
task_id = #{taskId} and status != 1 and status!=2
|
||||
</select>
|
||||
<select id="selectPurchasePartDetailsStatusIsNoPass" resultType="java.lang.Integer">
|
||||
select count(*) from purchase_part_details where task_id = #{taskId} and status != 2
|
||||
</select>
|
||||
<select id="getAcceptanceForm" parameterType="com.bonus.sgzb.material.domain.PurchasePartDetails" resultMap="PurchasePartDetailsResult">
|
||||
select pcd.id,pcd.task_id, pcd.part_id, pcd.purchase_price, pcd.purchase_num, pcd.check_num,
|
||||
pcd.check_result,pcd.`status`,
|
||||
CASE
|
||||
WHEN pcd.`status` = 0 THEN '待验收'
|
||||
WHEN pcd.`status` = 1 THEN '已验收'
|
||||
WHEN pcd.`status` = 2 THEN '验收不通过'
|
||||
WHEN pcd.`status` = 3 THEN '已入库'
|
||||
WHEN pcd.`status` = 4 THEN '入库不通过'
|
||||
ELSE ''
|
||||
END AS statusResult,
|
||||
pcd.supplier_id, msi.supplier, pcd.create_by, pcd.production_time, pcd.create_time,
|
||||
pcd.file_name, pcd.file_url,pcd.update_by, pcd.update_time, pcd.remark, pcd.company_id,
|
||||
mt1.pa_name machineTypeName,mt.pa_name specificationType, tk.code ,mt.pa_name typeName,
|
||||
mt.unit_id unitName
|
||||
from purchase_part_details pcd
|
||||
left join ma_part_type mt on pcd.part_id = mt.pa_id
|
||||
left join ma_part_type mt1 on mt.parent_id = mt1.pa_id
|
||||
left join ma_supplier_info msi on pcd.supplier_id = msi.supplier_id
|
||||
left join tm_task tk on pcd.task_id = tk.task_id
|
||||
where
|
||||
pcd.`status`=3 and pcd.`status`=1
|
||||
<if test="taskId != null ">and pcd.task_id = #{taskId}</if>
|
||||
<if test="keyWord != null and keyWord != ''">and (mt.pa_name like concat('%',#{keyWord},'%')
|
||||
or mt1.pa_name like concat('%',#{keyWord}) or msi.supplier like concat('%',#{keyWord}))
|
||||
</if>
|
||||
<if test="partId != null ">and pcd.part_id = #{partId}</if>
|
||||
<if test="purchasePrice != null and purchasePrice != ''">and pcd.purchase_price = #{purchasePrice}</if>
|
||||
<if test="purchaseNum != null ">and pcd.purchase_num = #{purchaseNum}</if>
|
||||
<if test="supplierId != null ">and pcd.supplier_id = #{supplierId}</if>
|
||||
<if test="productionTime != null ">and pcd.production_time = #{productionTime}</if>
|
||||
<if test="companyId != null ">and pcd.company_id = #{companyId}</if>
|
||||
</select>
|
||||
|
||||
<select id="warehousingEntry" resultType="com.bonus.sgzb.material.domain.PurchasePartDetails">
|
||||
SELECT pcd.id,
|
||||
mt.pa_id as partId,
|
||||
mt1.pa_id as modelId,
|
||||
mt.pa_name specificationType,
|
||||
mt1.pa_name typeName,
|
||||
pcd.check_num as checkNum,
|
||||
pcd.`status`,
|
||||
CASE
|
||||
WHEN pcd.`status` = 0 THEN '待验收'
|
||||
WHEN pcd.`status` = 1 THEN '待入库'
|
||||
WHEN pcd.`status` = 2 THEN '验收不通过'
|
||||
WHEN pcd.`status` = 3 THEN '已入库'
|
||||
WHEN pcd.`status` = 4 THEN '入库不通过'
|
||||
ELSE ''
|
||||
END AS statusResult,
|
||||
|
||||
pcd.task_id taskId,
|
||||
|
||||
CASE tt.task_status
|
||||
WHEN 70 THEN
|
||||
tt.update_time
|
||||
ELSE
|
||||
''
|
||||
END as inputTime,
|
||||
CASE tt.task_status
|
||||
WHEN 70 THEN
|
||||
us.user_name
|
||||
ELSE
|
||||
''
|
||||
END as inputBy
|
||||
FROM purchase_part_details pcd
|
||||
LEFT JOIN ma_part_type mt ON pcd.part_id = mt.pa_id
|
||||
LEFT JOIN ma_part_type mt1 ON mt.parent_id = mt1.pa_id
|
||||
LEFT JOIN tm_task tt on tt.task_id = pcd.task_id
|
||||
LEFT JOIN sys_user us on us.user_id = tt.update_by
|
||||
WHERE pcd.task_id = #{taskId}
|
||||
and pcd.`status`=3
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -212,6 +212,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
task_id = #{taskId} and status != 1 and status!=3
|
||||
</select>
|
||||
<select id="getAcceptanceForm" resultType="com.bonus.sgzb.material.domain.PurchaseCheckDetails">
|
||||
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 ,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
|
||||
left join ma_supplier_info msi on pcd.supplier_id = msi.supplier_id
|
||||
left join tm_task tk on pcd.task_id = tk.task_id
|
||||
where 1=1
|
||||
and pcd.status !=3
|
||||
AND (
|
||||
(pcd.bind_num IS NULL OR pcd.bind_num = 0) AND pcd.STATUS != 5
|
||||
OR (pcd.bind_num IS NOT NULL AND pcd.bind_num != 0)
|
||||
)
|
||||
<if test="taskId != null ">and pcd.task_id = #{taskId}</if>
|
||||
<if test="keyWord != null and keyWord != ''">and (mt.type_name like concat('%',#{keyWord},'%')
|
||||
or mt1.type_name like concat('%',#{keyWord}) or msi.supplier like concat('%',#{keyWord}))
|
||||
</if>
|
||||
<if test="typeId != null ">and pcd.type_id = #{typeId}</if>
|
||||
<if test="purchasePrice != null and purchasePrice != ''">and pcd.purchase_price = #{purchasePrice}</if>
|
||||
<if test="purchaseNum != null ">and pcd.purchase_num = #{purchaseNum}</if>
|
||||
<if test="supplierId != null ">and pcd.supplier_id = #{supplierId}</if>
|
||||
<if test="productionTime != null ">and pcd.production_time = #{productionTime}</if>
|
||||
<if test="companyId != null ">and pcd.company_id = #{companyId}</if>
|
||||
</select>
|
||||
|
||||
<delete id="deleteCheckDetailsByTaskId">
|
||||
delete from purchase_check_details where task_id = #{taskId}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
|
||||
select count(*) from purchase_macode_info where task_id = #{taskId} and status not in ('1','2')
|
||||
select count(*) from purchase_check_details where task_id = #{taskId} and status ='1'
|
||||
</select>
|
||||
|
||||
<insert id="insertMaInputRecord" parameterType="com.bonus.sgzb.material.domain.MaInputRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
@ -351,9 +351,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
</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 , 1), pmi.status) status,mm.qr_code qrCode,mm.ma_id maId,
|
||||
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,
|
||||
CASE
|
||||
WHEN pmi.ma_code is null THEN
|
||||
CASE
|
||||
WHEN pcd.status = 4 THEN 1
|
||||
WHEN pcd.status = 5 THEN 2
|
||||
ELSE 0
|
||||
END
|
||||
ELSE pmi.status
|
||||
END AS status,
|
||||
mm.qr_code qrCode,
|
||||
mm.ma_id maId,
|
||||
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
|
||||
|
|
@ -362,6 +380,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join ma_type mt1 on mt.parent_id = mt1.type_id
|
||||
where pcd.task_id = #{taskId}
|
||||
and pcd.`status`!=3
|
||||
<if test="dictName != null and dictName != ''">
|
||||
and (mt.type_name like concat('%',#{dictName},'%') or
|
||||
mt1.type_name like concat('%',#{dictName},'%'))
|
||||
</if>
|
||||
order by status
|
||||
</select>
|
||||
<select id="selectMaCode" resultType="java.lang.Integer">
|
||||
|
|
@ -372,6 +394,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
from ma_machine_label
|
||||
where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{nowDate},'%y%m')
|
||||
</select>
|
||||
<select id="warehousingEntry" resultType="com.bonus.sgzb.material.domain.PurchaseMacodeInfo">
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
(
|
||||
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,
|
||||
CASE
|
||||
|
||||
WHEN pmi.ma_code IS NULL THEN
|
||||
CASE
|
||||
|
||||
WHEN pcd.STATUS = 4 THEN
|
||||
1
|
||||
WHEN pcd.STATUS = 5 THEN
|
||||
2 ELSE 0
|
||||
END ELSE pmi.STATUS
|
||||
END AS STATUS,
|
||||
mm.qr_code qrCode,
|
||||
mm.ma_id maId,
|
||||
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}
|
||||
AND pcd.`status` != 3
|
||||
<if test="dictName != null and dictName != ''">
|
||||
and (mt.type_name like concat('%',#{dictName},'%') or
|
||||
mt1.type_name like concat('%',#{dictName},'%'))
|
||||
</if>
|
||||
ORDER BY
|
||||
STATUS
|
||||
) aa
|
||||
WHERE
|
||||
`status` != 0
|
||||
AND `status` !=2
|
||||
</select>
|
||||
|
||||
<update id="updateTypeByTypeId">
|
||||
update ma_type set num = #{num} where type_id = #{typeId}
|
||||
|
|
|
|||
Loading…
Reference in New Issue