This commit is contained in:
zzyuan 2024-04-20 17:03:39 +08:00
commit 8c7453aa23
20 changed files with 328 additions and 129 deletions

View File

@ -10,9 +10,11 @@ import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo; import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.log.annotation.Log; import com.bonus.sgzb.common.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType; import com.bonus.sgzb.common.log.enums.BusinessType;
import com.bonus.sgzb.common.security.utils.SecurityUtils;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -36,7 +38,15 @@ public class PurchaseInputController extends BaseController {
@GetMapping("list") @GetMapping("list")
public AjaxResult getbackReceiveList(PurchaseCheckInfo bean) { public AjaxResult getbackReceiveList(PurchaseCheckInfo bean) {
try { try {
List<PurchaseCheckInfo> list =purchaseInputService.getList(bean); List<PurchaseCheckInfo> list = new ArrayList<>();
//判断该组织是否开启综合服务中心审核
Long companyId = SecurityUtils.getLoginUser().getSysUser().getCompanyId();
int re = purchaseInputService.selectExamineType(companyId);
if (re>0){
list = purchaseInputService.selectPutInListExamine(bean);
}else {
list =purchaseInputService.getList(bean);
}
return success(list); return success(list);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);

View File

@ -94,6 +94,10 @@ public class PurchaseMacodeInfo extends BaseEntity
@ApiModelProperty(value = "固定资产编码") @ApiModelProperty(value = "固定资产编码")
private String assetsCode; private String assetsCode;
/** 管理方式 */
@ApiModelProperty(value = "管理方式")
private String manageType;
@ApiModelProperty(value = "采购时间") @ApiModelProperty(value = "采购时间")
private String purchaseTime; private String purchaseTime;
@ -301,6 +305,14 @@ public class PurchaseMacodeInfo extends BaseEntity
this.statusFlag = statusFlag; this.statusFlag = statusFlag;
} }
public String getManageType() {
return manageType;
}
public void setManageType(String manageType) {
this.manageType = manageType;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

View File

@ -25,12 +25,12 @@ public interface PurchaseInputMapper {
List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo bean); List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo bean);
/** /**
* 查询 * 查询新购入库任务列表
* *
* @param taskId 查询条件 * @param taskId 查询条件
* @return 结果 * @return 结果
*/ */
String selectTypeNameByTaskId(Long taskId); String selectTypeNameByTaskId(@Param("taskId") Long taskId,@Param("type") String type);
/** /**
* 查询 * 查询
@ -70,7 +70,7 @@ public interface PurchaseInputMapper {
* @param typeId 查询条件 * @param typeId 查询条件
* @return 结果 * @return 结果
*/ */
BigDecimal selectInputNUmByTypeId(@Param("taskId") Long taskId, @Param("typeId") Long typeId); BigDecimal selectInputNumByTypeId(@Param("taskId") Long taskId, @Param("typeId") Long typeId);
/** /**
* 修改 * 修改
@ -131,4 +131,56 @@ public interface PurchaseInputMapper {
* @return * @return
*/ */
int selectPurchaseCheckDetailsStatus(Long taskId); int selectPurchaseCheckDetailsStatus(Long taskId);
/**
* 删除ma_machine表
* @param maId
* @return 结果
*/
int deleteMaMachineInfoByMaId(Long maId);
/**
* 删除ma_machine_label表
* @param maId
* @return int
*/
int deleteMaMachineLabelByMaId(Long maId);
/**
* 删除ma_label_bind表
* @param maId
* @return int
*/
int deleteMaLabelBindByMaId(Long maId);
/**
* 删除purchase_macode_info表
* @param taskId
* @param typeId
* @param maCode
* @return
*/
int updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId(@Param("taskId") Long taskId,@Param("typeId") Long typeId,@Param("maCode") String maCode);
/**
* 修改purchase_check_details表
* @param typeId
* @param taskId
* @return int
*/
int updatePurchaseCheckDetailsByTaskId(@Param("taskId") Long taskId,@Param("typeId") Long typeId);
/**
* 查询组织是否开启审核
* @param companyId
* @return int
*/
int selectExamineType(Long companyId);
/**
* 查询
* @param bean
* @return
*/
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo bean);
} }

View File

@ -35,4 +35,18 @@ public interface PurchaseInputService {
* @return 修改结果 * @return 修改结果
*/ */
int modifyManageStatus(MaInputVO maInputVO); int modifyManageStatus(MaInputVO maInputVO);
/**
* 查询组织是否开启审核
* @param companyId
* @return int
*/
int selectExamineType(Long companyId);
/**
* 查询新购入库任务列表
* @param bean
* @return
*/
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo bean);
} }

View File

@ -29,7 +29,7 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
public List<PurchaseCheckInfo> getList(PurchaseCheckInfo bean) { public List<PurchaseCheckInfo> getList(PurchaseCheckInfo bean) {
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseInputMapper.selectPutInListList(bean); List<PurchaseCheckInfo> purchaseCheckInfos = purchaseInputMapper.selectPutInListList(bean);
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) { for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
String typeName = purchaseInputMapper.selectTypeNameByTaskId(checkInfo.getTaskId()); String typeName = purchaseInputMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"2");
checkInfo.setPurchasingTypeName(typeName); checkInfo.setPurchasingTypeName(typeName);
} }
return purchaseCheckInfos; return purchaseCheckInfos;
@ -51,76 +51,91 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
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("1".equals(checkResult) ? "15":"14");
purchaseInputMapper.updateMaMachine(maMachine); //修改编码管理表入库状态
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
purchaseMacodeInfo.setTaskId(taskId);
purchaseMacodeInfo.setTypeId(typeId);
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
// 修改验收任务详细表入库数量 // 修改验收任务详细表入库数量
if ("1".equals(checkResult)) { if ("1".equals(checkResult)) {
//修改机具状态为在库
maMachine.setMaStatus("15");
purchaseInputMapper.updateMaMachine(maMachine);
// 修改编码管理的入库状态 // 修改编码管理的入库状态
MaType maType = purchaseInputMapper.selectTypeByTypeId(typeId); MaType maType = purchaseInputMapper.selectTypeByTypeId(typeId);
// 库存添加 // 库存添加
maType.setNum((maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum()) maType.setNum((maInputRecord.getInputNum() == null ? new BigDecimal(0) : maInputRecord.getInputNum())
.add(maType.getNum() == null ? new BigDecimal(0):maType.getNum())); .add(maType.getNum() == null ? new BigDecimal(0) : maType.getNum()));
purchaseInputMapper.updateTypeByTypeId(maType); purchaseInputMapper.updateTypeByTypeId(maType);
BigDecimal inputNum = purchaseInputMapper.selectInputNUmByTypeId(taskId, typeId);
BigDecimal inputNum = purchaseInputMapper.selectInputNumByTypeId(taskId, typeId);
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails(); PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
purchaseCheckDetails.setTaskId(taskId); purchaseCheckDetails.setTaskId(taskId);
purchaseCheckDetails.setTypeId(typeId); purchaseCheckDetails.setTypeId(typeId);
purchaseCheckDetails.setInputNum(inputNum.add(maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum())); purchaseCheckDetails.setInputNum(inputNum.add(maInputRecord.getInputNum() == null ? new BigDecimal(0) : maInputRecord.getInputNum()));
purchaseCheckDetails.setStatus(4); purchaseCheckDetails.setStatus(4);
purchaseInputMapper.updateByTaskIdTypeId(purchaseCheckDetails); purchaseInputMapper.updateByTaskIdTypeId(purchaseCheckDetails);
// 新增入库任务详细表 // 新增入库任务详细表
InputApplyDetails applyDetails = new InputApplyDetails(); InputApplyDetails applyDetails = new InputApplyDetails();
applyDetails.setTaskId(taskId); applyDetails.setTaskId(taskId);
applyDetails.setTypeId(typeId); applyDetails.setTypeId(typeId);
applyDetails.setInputNum(maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum()); applyDetails.setInputNum(maInputRecord.getInputNum() == null ? new BigDecimal(0) : maInputRecord.getInputNum());
applyDetails.setMaId(maInputRecord.getMaId()); applyDetails.setMaId(maInputRecord.getMaId());
applyDetails.setInputType("1"); applyDetails.setInputType("1");
applyDetails.setCreateTime(new Date()); applyDetails.setCreateTime(new Date());
applyDetails.setCreateBy(SecurityUtils.getUsername()); applyDetails.setCreateBy(SecurityUtils.getUsername());
applyDetails.setCompanyId(maInputRecord.getCompanyId()); applyDetails.setCompanyId(maInputRecord.getCompanyId());
purchaseInputMapper.insertInputApplyDetails(applyDetails); purchaseInputMapper.insertInputApplyDetails(applyDetails);
purchaseMacodeInfo.setStatus("1");
purchaseInputMapper.updateMacodeByType(purchaseMacodeInfo);
// 新增入库记录
purchaseInputMapper.insertMaInputRecord(maInputRecord);
} else {
//删除ma_machine表
purchaseInputMapper.deleteMaMachineInfoByMaId(maInputRecord.getMaId());
//删除ma_machine_label表
purchaseInputMapper.deleteMaMachineLabelByMaId(maInputRecord.getMaId());
//删除ma_label_bind表
purchaseInputMapper.deleteMaLabelBindByMaId(maInputRecord.getMaId());
//修改purchase_macode_info表
purchaseInputMapper.updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId(taskId, typeId, maInputRecord.getMaCode());
//修改purchase_check_details表
purchaseInputMapper.updatePurchaseCheckDetailsByTaskId(taskId, typeId);
} }
// 修改编码管理表入库状态
PurchaseMacodeInfo purchaseMacodeInfo = new PurchaseMacodeInfo();
purchaseMacodeInfo.setTaskId(taskId);
purchaseMacodeInfo.setTypeId(typeId);
purchaseMacodeInfo.setMaCode(maInputRecord.getMaCode());
purchaseMacodeInfo.setStatus("1".equals(checkResult) ? "1" : "0");
purchaseInputMapper.updateMacodeByType(purchaseMacodeInfo);
// 新增入库记录
purchaseInputMapper.insertMaInputRecord(maInputRecord);
} }
//判断是否全部已操作通过或不通过 //判断是否全部已操作通过或不通过
int count=purchaseInputMapper.isOperateAll(taskId); int count=purchaseInputMapper.isOperateAll(taskId);
if (count<=0){ if (count<=0){
//是否为全部不通过 //全部审核任务状态改为已审核
int count1 = purchaseInputMapper.selectPurchaseCheckDetailsStatus(taskId); TmTask task = new TmTask();
if (count1>0){ task.setTaskId(taskId);
TmTask task = new TmTask(); task.setTaskStatus(28);
task.setTaskId(taskId); task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setTaskStatus(28); task.setUpdateTime(DateUtils.getNowDate());
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid())); purchaseInputMapper.updateTmTask(task);
task.setUpdateTime(DateUtils.getNowDate());
purchaseInputMapper.updateTmTask(task);
}else {
TmTask task = new TmTask();
task.setTaskId(taskId);
task.setTaskStatus(107);
task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
task.setUpdateTime(DateUtils.getNowDate());
purchaseInputMapper.updateTmTask(task);
}
} }
// // 当全部为已入库的时候任务改为入库状态
// Integer count = purchaseInputMapper.selectMacodeInfoStatusByTaskId(taskId);
// if (count <= 0) {
// TmTask task = new TmTask();
// task.setTaskId(taskId);
// task.setTaskStatus(28);
// task.setUpdateBy(String.valueOf(SecurityUtils.getLoginUser().getUserid()));
// task.setUpdateTime(DateUtils.getNowDate());
// purchaseInputMapper.updateTmTask(task);
// }
return 1; return 1;
} }
@Override
public int selectExamineType(Long companyId) {
return purchaseInputMapper.selectExamineType(companyId);
}
@Override
public List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo bean) {
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseInputMapper.selectPutInListExamine(bean);
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
String typeName = purchaseInputMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"3");
checkInfo.setPurchasingTypeName(typeName);
}
return purchaseCheckInfos;
}
} }

View File

@ -601,7 +601,7 @@
tt.task_status AS taskStatus, tt.task_status AS taskStatus,
sd.`name` AS taskName, sd.`name` AS taskName,
tta.agreement_id AS agreementId, tta.agreement_id AS agreementId,
GROUP_CONCAT( DISTINCT bad.type_id ) AS typeId, GROUP_CONCAT( DISTINCT mt2.type_id ) AS typeId,
GROUP_CONCAT(bad.id) as badId, GROUP_CONCAT(bad.id) as badId,
GROUP_CONCAT( mt2.type_name, '' ) AS typeName GROUP_CONCAT( mt2.type_name, '' ) AS typeName
FROM FROM
@ -648,7 +648,7 @@
bagi.plan_start_time bagi.plan_start_time
<if test="typeId != null and typeId != ''"> <if test="typeId != null and typeId != ''">
HAVING HAVING
FIND_IN_SET(#{typeId}, GROUP_CONCAT(DISTINCT bad.type_id)) FIND_IN_SET(#{typeId}, GROUP_CONCAT(DISTINCT mt2.type_id))
</if> </if>
ORDER BY ORDER BY
tt.task_status ASC, tt.task_status ASC,

View File

@ -111,22 +111,45 @@
</trim> </trim>
where task_id = #{taskId} where task_id = #{taskId}
</update> </update>
<update id="updatetePurchaseMaCodeInfoByMaCodeAndTaskIdAndTypeId">
update
purchase_macode_info
set status='2'
where ma_code = #{maCode}
and task_id = #{taskId}
and type_id = #{typeId}
</update>
<update id="updatePurchaseCheckDetailsByTaskId">
update purchase_check_details set bind_num = bind_num - 1 , status='5' where task_id = #{taskId} and type_id = #{typeId}
</update>
<delete id="deleteMaMachineInfoByMaId">
delete from ma_machine where ma_id = #{maId}
</delete>
<delete id="deleteMaMachineLabelByMaId">
delete from ma_machine_label where ma_id = #{maId}
</delete>
<delete id="deleteMaLabelBindByMaId">
delete from ma_label_bind where ma_id = #{maId}
</delete>
<select id="selectPutInListList" resultType="com.bonus.sgzb.app.domain.PurchaseCheckInfo"> <select id="selectPutInListList" resultType="com.bonus.sgzb.app.domain.PurchaseCheckInfo">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time, pci.update_by, select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.nick_name purchaserName, pci.update_by,
tk.create_by pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status
from purchase_check_info pci taskStatus,su.nick_name purchaserName,
left join tm_task tk on pci.task_id = tk.task_id tk.create_by
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id from purchase_check_info pci
left join sys_user su on pci.purchaser = su.user_id left join tm_task tk on pci.task_id = tk.task_id
where task_type = 23 and tk.task_status in (26,28) left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if> left join sys_user su on pci.purchaser = su.user_id
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if> where task_type = 23 and tk.task_status in (26,28,107)
<if test="arrivalTime != null and arrivalTime != ''"> and pci.arrival_time = #{arrivalTime}</if> <if test="keyWord != null and keyWord != ''">and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaser != null "> and pci.purchaser = #{purchaser}</if> <if test="purchaseTime != null and purchaseTime != ''">and pci.purchase_time = #{purchaseTime}</if>
<if test="companyId != null "> and pci.company_id = #{companyId}</if> <if test="arrivalTime != null and arrivalTime != ''">and pci.arrival_time = #{arrivalTime}</if>
order by pci.id desc <if test="purchaser != null ">and pci.purchaser = #{purchaser}</if>
<if test="companyId != null ">and pci.company_id = #{companyId}</if>
order by pci.id desc
</select> </select>
<select id="selectTypeNameByTaskId" resultType="java.lang.String"> <select id="selectTypeNameByTaskId" resultType="java.lang.String">
@ -136,21 +159,43 @@
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
where pcd.task_id = #{taskId} where pcd.task_id = #{taskId}
<if test="type == 2">and pcd.`status`!=3</if>
<if test="type == 3">and pcd.`status`!=3 and pcd.`status` !=7</if>
) t ) t
GROUP BY task_id GROUP BY task_id
</select> </select>
<select id="selectPutinDetails" resultType="com.bonus.sgzb.app.domain.PurchaseMacodeInfo"> <select id="selectPutinDetails" resultType="com.bonus.sgzb.app.domain.PurchaseMacodeInfo">
select pcd.production_time productionTime,mt.type_name specificationType, mt1.type_name typeName, pmi.ma_code maCode, select pcd.production_time productionTime,
mm.assets_code assetsCode ,pmi.fix_code fixCode,pcd.type_id typeId,pcd.task_id taskId, mt.code specsCode,mt1.code typeCode, mt.type_name specificationType,
if(pmi.ma_code is null, if(pcd.status != 4, 0 , 1), pmi.status) status,mm.qr_code qrCode,mm.ma_id maId, mt1.type_name typeName,
if(pmi.ma_code is not null,1,pcd.check_num) checkNum mt.manage_type as manageType,
from purchase_check_details pcd pmi.ma_code maCode,
left join purchase_macode_info pmi on pmi.task_id = pcd.task_id and pmi.type_id = pcd.type_id mm.assets_code assetsCode,
left join ma_machine mm on pmi.ma_code = mm.ma_code pmi.fix_code fixCode,
left join ma_type mt on pcd.type_id = mt.type_id pcd.type_id typeId,
left join ma_type mt1 on mt.parent_id = mt1.type_id pcd.task_id taskId,
where pcd.task_id = #{taskId} mt.code specsCode,
order by status 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 and pcd.`status`!=7
order by status
</select> </select>
<select id="selectTypeByTypeId" resultType="com.bonus.sgzb.base.api.domain.MaType"> <select id="selectTypeByTypeId" resultType="com.bonus.sgzb.base.api.domain.MaType">
select type_id typeId, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price, select type_id typeId, type_name, parent_id, status, num, unit_id, manage_type, lease_price, buy_price, pay_price,
@ -158,7 +203,7 @@
create_time, remark, company_id create_time, remark, company_id
from ma_type where type_id = #{typeId} from ma_type where type_id = #{typeId}
</select> </select>
<select id="selectInputNUmByTypeId" resultType="java.math.BigDecimal"> <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 IFNULL(input_num,0) from purchase_check_details where task_id = #{taskId} and type_id = #{typeId}
</select> </select>
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer"> <select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
@ -180,4 +225,34 @@
WHERE WHERE
task_id = #{taskId} and status =4 task_id = #{taskId} and status =4
</select> </select>
<select id="selectExamineType" resultType="java.lang.Integer">
SELECT
COUNT(*)
FROM
bm_flow_relation bfr
LEFT JOIN bm_flow bf on bfr.flow_id=bf.id
WHERE
bf.task_type='23'
AND bfr.company_id = #{companyId}
and bfr.`status`='1'
and bf.`status`='1'
</select>
<select id="selectPutInListExamine" resultType="com.bonus.sgzb.app.domain.PurchaseCheckInfo">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status
taskStatus,su.nick_name purchaserName,
tk.create_by
from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id
where task_type = 23 and tk.task_status in (105,28,107)
<if test="keyWord != null and keyWord != ''">and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''">and pci.purchase_time = #{purchaseTime}</if>
<if test="arrivalTime != null and arrivalTime != ''">and pci.arrival_time = #{arrivalTime}</if>
<if test="purchaser != null ">and pci.purchaser = #{purchaser}</if>
<if test="companyId != null ">and pci.company_id = #{companyId}</if>
order by pci.id desc
</select>
</mapper> </mapper>

View File

@ -141,7 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmProjectInfo"> <select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmProjectInfo">
select * from bm_project_info select * from bm_project_info
where where
1 = 1 del_flag = '0' and status = '0'
<if test="proName != null and proName != ''">and pro_name = #{proName}</if> <if test="proName != null and proName != ''">and pro_name = #{proName}</if>
</select> </select>

View File

@ -89,7 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmProjectLot"> <select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmProjectLot">
select * from bm_project_lot select * from bm_project_lot
where where
1 = 1 del_flag = '0' and status = '0'
<if test="lotName != null and lotName != ''">and lot_name = #{lotName}</if> <if test="lotName != null and lotName != ''">and lot_name = #{lotName}</if>
</select> </select>

View File

@ -174,7 +174,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmUnitInfo"> <select id="selectByName" resultType="com.bonus.sgzb.base.domain.BmUnitInfo">
select * from bm_unit_info select * from bm_unit_info
where where
1 = 1 del_flag = '0' and status = '0'
<if test="unitName != null and unitName != '' ">and unit_name = #{unitName}</if> <if test="unitName != null and unitName != '' ">and unit_name = #{unitName}</if>
</select> </select>

View File

@ -66,7 +66,7 @@
<select id="selectByName" resultType="com.bonus.sgzb.base.api.domain.SysDic"> <select id="selectByName" resultType="com.bonus.sgzb.base.api.domain.SysDic">
select * from sys_dic select * from sys_dic
where where
1 = 1 status != 2
<if test="name != null and name != ''">and name = #{name}</if> <if test="name != null and name != ''">and name = #{name}</if>
</select> </select>

View File

@ -126,7 +126,7 @@ public class BackApplyInfo extends BaseEntity {
@ApiModelProperty(value = "协议编号") @ApiModelProperty(value = "协议编号")
private String agreementCode; private String agreementCode;
@Excel(name = "退料状态" , readConverterExp = "37=待退料审核,38=退料已审核,39=退料核查中,40=退料完成") @Excel(name = "退料状态" , readConverterExp = "37=待退料审核,38=退料已审核,39=退料核查中,40=退料完成,101 = 退料审核驳回")
@ApiModelProperty(value = "任务状态") @ApiModelProperty(value = "任务状态")
private String taskStatus; private String taskStatus;

View File

@ -649,7 +649,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tta.agreement_id as agreementId, tta.agreement_id as agreementId,
GROUP_CONCAT(bai.company_id) as companyId, GROUP_CONCAT(bai.company_id) as companyId,
GROUP_CONCAT(bad.id) as badId, GROUP_CONCAT(bad.id) as badId,
GROUP_CONCAT(DISTINCT bad.type_id) as typeId, GROUP_CONCAT(DISTINCT mt2.type_id) as typeId,
GROUP_CONCAT(mt2.type_name) AS typeName, GROUP_CONCAT(mt2.type_name) AS typeName,
GROUP_CONCAT(bad.status) AS status GROUP_CONCAT(bad.status) AS status
FROM FROM
@ -692,6 +692,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<![CDATA[AND DATE_FORMAT( bai.back_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]> <![CDATA[AND DATE_FORMAT( bai.back_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime} ]]>
</if> </if>
GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time GROUP BY bai.id, us.user_name, bai.phone, bpl.lot_name, bui.unit_name, bagi.plan_start_time
<if test="typeId != null and typeId != ''">
HAVING FIND_IN_SET(#{typeId}, typeId) > 0
</if>
ORDER BY bai.create_time desc ORDER BY bai.create_time desc
</select> </select>

View File

@ -164,32 +164,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</insert> </insert>
<select id="selectPutInListList" resultMap="PurchaseCheckInfoResult"> <select id="selectPutInListList" resultMap="PurchaseCheckInfoResult">
select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time, pci.update_by, select pci.id,pci.task_id, pci.purchase_time, pci.arrival_time, pci.purchaser, pci.create_by, pci.create_time,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.user_name purchaserName, pci.update_by,
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status
taskStatus,su.user_name purchaserName,
tk.create_by, tk.create_by,
CASE tk.task_status CASE tk.task_status
WHEN 28 THEN WHEN 28 THEN
tk.update_time tk.update_time
ELSE ELSE
'' ''
END as inputTime, END as inputTime,
CASE tk.task_status CASE tk.task_status
WHEN 28 THEN WHEN 28 THEN
us.user_name us.user_name
ELSE ELSE
'' ''
END as inputUser END as inputUser
from purchase_check_info pci from purchase_check_info pci
left join tm_task tk on pci.task_id = tk.task_id left join tm_task tk on pci.task_id = tk.task_id
left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id left join (select id,name from sys_dic where p_id = 50) dict on tk.task_status = dict.id
left join sys_user su on pci.purchaser = su.user_id left join sys_user su on pci.purchaser = su.user_id
LEFT JOIN sys_user us on us.user_id = tk.update_by LEFT JOIN sys_user us on us.user_id = tk.update_by
where task_type = 23 and tk.task_status in (26,28,107) where task_type = 23 and tk.task_status in (26,28,107)
<if test="keyWord != null and keyWord != ''"> and tk.code like concat('%',#{keyWord},'%')</if> <if test="keyWord != null and keyWord != ''">and tk.code like concat('%',#{keyWord},'%')</if>
<if test="purchaseTime != null and purchaseTime != ''"> and pci.purchase_time = #{purchaseTime}</if> <if test="purchaseTime != null and purchaseTime != ''">and pci.purchase_time = #{purchaseTime}</if>
<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>
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id <if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
FROM purchase_check_details pcd FROM purchase_check_details pcd
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id LEFT JOIN ma_type mt on mt.type_id=pcd.type_id

View File

@ -528,7 +528,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
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 id="updateMacodeByType">
update purchase_macode_info set status = #{status} where task_id = #{taskId} and type_id = #{typeId} update purchase_macode_info
and ma_code = #{maCode} set status = #{status}
where task_id = #{taskId}
and type_id = #{typeId}
and ma_code = #{maCode}
</update> </update>
</mapper> </mapper>

View File

@ -183,6 +183,7 @@
:options="deptOptions" :options="deptOptions"
placeholder="请选择所属上级" placeholder="请选择所属上级"
@select="select" @select="select"
@input="resetValidation"
/> />
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="linkMan"> <el-form-item label="联系人" prop="linkMan">
@ -265,7 +266,7 @@ export default {
{ required: true, message: "单位名称不能为空", trigger: "blur" } { required: true, message: "单位名称不能为空", trigger: "blur" }
], ],
typeId: [ typeId: [
{ required: true, message: "单位类型不能为空", trigger: "blur" } { required: true, message: "单位类型不能为空", trigger: "change" }
], ],
deptId: [ deptId: [
{ required: true, message: "所属上级不能为空", trigger: "blur" } { required: true, message: "所属上级不能为空", trigger: "blur" }
@ -302,6 +303,9 @@ export default {
// console.log(row.label) // console.log(row.label)
this.form.deptName = row.label; this.form.deptName = row.label;
}, },
resetValidation() {
this.$refs.form.clearValidate('deptId')
},
// //
changeStatus(row) { changeStatus(row) {
let param = { let param = {

View File

@ -41,18 +41,12 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="工机具类型" prop="typeId"> <el-form-item label="工机具类型" prop="typeId">
<el-cascader <Tree
v-model="queryParams.typeId" ref="mychildSon"
:options="deptOptions" :width="240"
:props="{ :dataList="deptList"
expandTrigger: 'hover', @changeId="selectDrop"
label: 'label', ></Tree>
value: 'id',
checkStrictly: true,
}"
@change="handleNodeClick"
aria-placeholder="请选择极具类型"
></el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="协议号" prop="agreementCode"> <el-form-item label="协议号" prop="agreementCode">
<el-input <el-input
@ -434,12 +428,14 @@ import {
import { getInfo, h } from '@/api/login' import { getInfo, h } from '@/api/login'
import { getUnitData, getProData, getAgreementInfoById } from '@/api/claimAndRefund/receive.js' import { getUnitData, getProData, getAgreementInfoById } from '@/api/claimAndRefund/receive.js'
import dialogForm from './dialogFormExame.vue' import dialogForm from './dialogFormExame.vue'
import { listPartTypeApi } from '@/api/repairTest/repair'
import Tree from './tree.vue'
// 10:42startTime,endTime typeId // 10:42startTime,endTime typeId
// http://localhost/claimAndRefund/return/returnApply // http://localhost/claimAndRefund/return/returnApply
export default { export default {
// name: "ReturnExamine", // name: "ReturnExamine",
dicts: ['sys_normal_disable'], dicts: ['sys_normal_disable'],
components: { dialogForm }, components: { dialogForm, Tree },
data() { data() {
return { return {
checkResultOne: false, checkResultOne: false,
@ -511,7 +507,7 @@ export default {
openTextTwo: '', openTextTwo: '',
openTextThree: '', openTextThree: '',
companyId: '', companyId: '',
deptOptions: [], deptList: [],
unitList: [], unitList: [],
proList: [], proList: [],
taskStatusList: [ taskStatusList: [
@ -546,6 +542,7 @@ export default {
this.initSelectData() this.initSelectData()
this.InitIGetInfo() this.InitIGetInfo()
this.getList() this.getList()
this.getTree()
}, },
methods: { methods: {
// claimAndRefund/return/returnApplyAdd // claimAndRefund/return/returnApplyAdd
@ -568,6 +565,11 @@ export default {
this.loading = false this.loading = false
} catch (error) {} } catch (error) {}
}, },
getTree() {
listPartTypeApi().then((response) => {
this.deptList = response.data
})
},
// //
cancel() { cancel() {
this.open = false this.open = false
@ -595,6 +597,7 @@ export default {
this.timeRange = [] this.timeRange = []
// this.resetForm("queryForm"); // this.resetForm("queryForm");
this.$refs.queryForm.resetFields() this.$refs.queryForm.resetFields()
this.$refs.mychildSon.inputValue = ''
this.initSelectData() this.initSelectData()
this.handleQuery() this.handleQuery()
}, },
@ -795,7 +798,9 @@ export default {
this.getList() this.getList()
}) })
}, },
handleNodeClick(ev) {}, selectDrop(value) {
this.queryParams.typeId = value
},
initSelectData() { initSelectData() {
this.GetUnitData() this.GetUnitData()
this.GetProData() this.GetProData()

View File

@ -62,19 +62,12 @@
/> />
</el-form-item> </el-form-item>
<el-form-item label="工机具类型" prop="typeId"> <el-form-item label="工机具类型" prop="typeId">
<el-cascader <Tree
v-model="queryParams.typeId" ref="mychildSon"
:options="deptOptions" :width="240"
:props="{ :dataList="deptList"
expandTrigger: 'hover', @changeId="selectDrop"
label: 'label', ></Tree>
value: 'id',
checkStrictly: true,
}"
@change="handleNodeClick"
aria-placeholder="请选择极具类型"
>
</el-cascader>
</el-form-item> </el-form-item>
<el-form-item label="退料状态" prop="taskStatus"> <el-form-item label="退料状态" prop="taskStatus">
@ -205,9 +198,11 @@
import { getInfo } from "@/api/login"; import { getInfo } from "@/api/login";
import { getUnitData, getProData, getAgreementInfoById, } from "@/api/claimAndRefund/receive.js" import { getUnitData, getProData, getAgreementInfoById, } from "@/api/claimAndRefund/receive.js"
import dialogForm from "./dialogFormExame.vue"; import dialogForm from "./dialogFormExame.vue";
import { listPartTypeApi } from '@/api/repairTest/repair'
import Tree from './tree.vue'
export default { export default {
// name: "ReturnExamine", // name: "ReturnExamine",
components: { dialogForm, }, components: { dialogForm, Tree },
data() { data() {
return { return {
type: '', type: '',
@ -248,7 +243,7 @@
endTime: '' endTime: ''
}, },
companyId: '', companyId: '',
deptOptions: [], deptList: [],
unitList: [], unitList: [],
proList: [], proList: [],
taskStatusList: [ taskStatusList: [
@ -279,6 +274,7 @@
created() { created() {
this.initSelectData() this.initSelectData()
this.InitIGetInfo() this.InitIGetInfo()
this.getTree()
}, },
methods: { methods: {
InitIGetInfo() { InitIGetInfo() {
@ -287,9 +283,15 @@
this.getList(); this.getList();
}) })
}, },
getTree() {
listPartTypeApi().then((response) => {
console.log('🚀 ~ listPartTypeApi ~ response.data:', response.data);
this.deptList = response.data
})
},
// //
handleNodeClick(ev) { selectDrop(value) {
this.queryParams.typeId = value
}, },
// //
initSelectData() { initSelectData() {
@ -367,8 +369,8 @@
resetQuery() { resetQuery() {
this.dateRange = []; this.dateRange = [];
// this.resetForm("queryForm"); // this.resetForm("queryForm");
this.$refs.queryForm.resetFields() this.$refs.queryForm.resetFields()
this.$refs.mychildSon.inputValue = ''
this.initSelectData() this.initSelectData()
this.handleQuery(); this.handleQuery();
}, },

View File

@ -115,7 +115,7 @@
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="岗位编号" align="center" prop="postId" /> <el-table-column label="岗位编号" type="index" align="center" width="80" />
<el-table-column label="岗位编码" align="center" prop="postCode" /> <el-table-column label="岗位编码" align="center" prop="postCode" />
<el-table-column label="岗位名称" align="center" prop="postName" /> <el-table-column label="岗位名称" align="center" prop="postName" />
<!-- <el-table-column label="岗位排序" align="center" prop="postSort" /> --> <!-- <el-table-column label="岗位排序" align="center" prop="postSort" /> -->
@ -209,6 +209,8 @@
v-model="form.remark" v-model="form.remark"
type="textarea" type="textarea"
placeholder="请输入内容" placeholder="请输入内容"
maxlength="100"
show-word-limit
/> />
</el-form-item> </el-form-item>
</el-form> </el-form>

View File

@ -922,7 +922,7 @@
} else { } else {
this.$alert( this.$alert(
"<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + "<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" +
'导入失败' + '导入失败: ' + response.msg +
'</div>', '</div>',
'导入结果', '导入结果',
{ dangerouslyUseHTMLString: true }, { dangerouslyUseHTMLString: true },