测试问题修改
This commit is contained in:
parent
45d551f864
commit
c180ad60e7
|
|
@ -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.log.annotation.Log;
|
||||
import com.bonus.sgzb.common.log.enums.BusinessType;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -36,7 +38,15 @@ public class PurchaseInputController extends BaseController {
|
|||
@GetMapping("list")
|
||||
public AjaxResult getbackReceiveList(PurchaseCheckInfo bean) {
|
||||
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);
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
|
|
|
|||
|
|
@ -94,6 +94,10 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
@ApiModelProperty(value = "固定资产编码")
|
||||
private String assetsCode;
|
||||
|
||||
/** 管理方式 */
|
||||
@ApiModelProperty(value = "管理方式")
|
||||
private String manageType;
|
||||
|
||||
@ApiModelProperty(value = "采购时间")
|
||||
private String purchaseTime;
|
||||
|
||||
|
|
@ -301,6 +305,14 @@ public class PurchaseMacodeInfo extends BaseEntity
|
|||
this.statusFlag = statusFlag;
|
||||
}
|
||||
|
||||
public String getManageType() {
|
||||
return manageType;
|
||||
}
|
||||
|
||||
public void setManageType(String manageType) {
|
||||
this.manageType = manageType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -25,12 +25,12 @@ public interface PurchaseInputMapper {
|
|||
List<PurchaseCheckInfo> selectPutInListList(PurchaseCheckInfo bean);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* 查询新购入库任务列表
|
||||
*
|
||||
* @param taskId 查询条件
|
||||
* @return 结果
|
||||
*/
|
||||
String selectTypeNameByTaskId(Long taskId);
|
||||
String selectTypeNameByTaskId(@Param("taskId") Long taskId,@Param("type") String type);
|
||||
|
||||
/**
|
||||
* 查询
|
||||
|
|
@ -70,7 +70,7 @@ public interface PurchaseInputMapper {
|
|||
* @param typeId 查询条件
|
||||
* @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
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
|
@ -35,4 +35,18 @@ public interface PurchaseInputService {
|
|||
* @return 修改结果
|
||||
*/
|
||||
int modifyManageStatus(MaInputVO maInputVO);
|
||||
|
||||
/**
|
||||
* 查询组织是否开启审核
|
||||
* @param companyId
|
||||
* @return int
|
||||
*/
|
||||
int selectExamineType(Long companyId);
|
||||
|
||||
/**
|
||||
* 查询新购入库任务列表
|
||||
* @param bean
|
||||
* @return
|
||||
*/
|
||||
List<PurchaseCheckInfo> selectPutInListExamine(PurchaseCheckInfo bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
|
|||
public List<PurchaseCheckInfo> getList(PurchaseCheckInfo bean) {
|
||||
List<PurchaseCheckInfo> purchaseCheckInfos = purchaseInputMapper.selectPutInListList(bean);
|
||||
for (PurchaseCheckInfo checkInfo : purchaseCheckInfos) {
|
||||
String typeName = purchaseInputMapper.selectTypeNameByTaskId(checkInfo.getTaskId());
|
||||
String typeName = purchaseInputMapper.selectTypeNameByTaskId(checkInfo.getTaskId(),"2");
|
||||
checkInfo.setPurchasingTypeName(typeName);
|
||||
}
|
||||
return purchaseCheckInfos;
|
||||
|
|
@ -51,76 +51,91 @@ public class PurchaseInputServiceImpl implements PurchaseInputService {
|
|||
MaMachine maMachine = new MaMachine();
|
||||
maMachine.setMaId(maInputRecord.getMaId());
|
||||
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)) {
|
||||
//修改机具状态为在库
|
||||
maMachine.setMaStatus("15");
|
||||
purchaseInputMapper.updateMaMachine(maMachine);
|
||||
|
||||
|
||||
// 修改编码管理的入库状态
|
||||
MaType maType = purchaseInputMapper.selectTypeByTypeId(typeId);
|
||||
// 库存添加
|
||||
maType.setNum((maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum())
|
||||
.add(maType.getNum() == null ? new BigDecimal(0):maType.getNum()));
|
||||
maType.setNum((maInputRecord.getInputNum() == null ? new BigDecimal(0) : maInputRecord.getInputNum())
|
||||
.add(maType.getNum() == null ? new BigDecimal(0) : maType.getNum()));
|
||||
purchaseInputMapper.updateTypeByTypeId(maType);
|
||||
BigDecimal inputNum = purchaseInputMapper.selectInputNUmByTypeId(taskId, typeId);
|
||||
|
||||
BigDecimal inputNum = purchaseInputMapper.selectInputNumByTypeId(taskId, typeId);
|
||||
PurchaseCheckDetails purchaseCheckDetails = new PurchaseCheckDetails();
|
||||
purchaseCheckDetails.setTaskId(taskId);
|
||||
purchaseCheckDetails.setTypeId(typeId);
|
||||
purchaseCheckDetails.setInputNum(inputNum.add(maInputRecord.getInputNum() == null ? new BigDecimal(0):maInputRecord.getInputNum()));
|
||||
purchaseCheckDetails.setInputNum(inputNum.add(maInputRecord.getInputNum() == null ? new BigDecimal(0) : maInputRecord.getInputNum()));
|
||||
purchaseCheckDetails.setStatus(4);
|
||||
purchaseInputMapper.updateByTaskIdTypeId(purchaseCheckDetails);
|
||||
|
||||
// 新增入库任务详细表
|
||||
InputApplyDetails applyDetails = new InputApplyDetails();
|
||||
applyDetails.setTaskId(taskId);
|
||||
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.setInputType("1");
|
||||
applyDetails.setCreateTime(new Date());
|
||||
applyDetails.setCreateBy(SecurityUtils.getUsername());
|
||||
applyDetails.setCompanyId(maInputRecord.getCompanyId());
|
||||
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);
|
||||
if (count<=0){
|
||||
//是否为全部不通过
|
||||
int count1 = purchaseInputMapper.selectPurchaseCheckDetailsStatus(taskId);
|
||||
if (count1>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);
|
||||
}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);
|
||||
}
|
||||
//全部审核任务状态改为已审核
|
||||
TmTask task = new TmTask();
|
||||
task.setTaskId(taskId);
|
||||
task.setTaskStatus(28);
|
||||
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;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,22 +111,45 @@
|
|||
</trim>
|
||||
where task_id = #{taskId}
|
||||
</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 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 (26,28)
|
||||
<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 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 (26,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>
|
||||
|
||||
<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 mt1 on mt.parent_id = mt1.type_id
|
||||
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
|
||||
GROUP BY task_id
|
||||
</select>
|
||||
<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,
|
||||
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,
|
||||
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}
|
||||
order by status
|
||||
select pcd.production_time productionTime,
|
||||
mt.type_name specificationType,
|
||||
mt1.type_name typeName,
|
||||
mt.manage_type as manageType,
|
||||
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 and pcd.`status`!=7
|
||||
order by status
|
||||
</select>
|
||||
<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,
|
||||
|
|
@ -158,7 +203,7 @@
|
|||
create_time, remark, company_id
|
||||
from ma_type where type_id = #{typeId}
|
||||
</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>
|
||||
<select id="selectMacodeInfoStatusByTaskId" resultType="java.lang.Integer">
|
||||
|
|
@ -180,4 +225,34 @@
|
|||
WHERE
|
||||
task_id = #{taskId} and status =4
|
||||
</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>
|
||||
|
|
@ -164,32 +164,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</insert>
|
||||
|
||||
<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,
|
||||
pci.update_time, pci.remark, pci.company_id ,dict.name purchasingStatus,tk.code,tk.task_status taskStatus,su.user_name purchaserName,
|
||||
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.user_name purchaserName,
|
||||
tk.create_by,
|
||||
CASE tk.task_status
|
||||
WHEN 28 THEN
|
||||
tk.update_time
|
||||
ELSE
|
||||
''
|
||||
END as inputTime,
|
||||
END as inputTime,
|
||||
CASE tk.task_status
|
||||
WHEN 28 THEN
|
||||
us.user_name
|
||||
ELSE
|
||||
''
|
||||
END as inputUser
|
||||
END as inputUser
|
||||
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
|
||||
LEFT JOIN sys_user us on us.user_id = tk.update_by
|
||||
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="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>
|
||||
<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>
|
||||
<if test="typeId != null">AND #{typeId} IN (SELECT mt2.type_id
|
||||
FROM purchase_check_details pcd
|
||||
LEFT JOIN ma_type mt on mt.type_id=pcd.type_id
|
||||
|
|
|
|||
|
|
@ -528,7 +528,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
update ma_machine set ma_status = #{maStatus} where ma_id = #{maId}
|
||||
</update>
|
||||
<update id="updateMacodeByType">
|
||||
update purchase_macode_info set status = #{status} where task_id = #{taskId} and type_id = #{typeId}
|
||||
and ma_code = #{maCode}
|
||||
update purchase_macode_info
|
||||
set status = #{status}
|
||||
where task_id = #{taskId}
|
||||
and type_id = #{typeId}
|
||||
and ma_code = #{maCode}
|
||||
</update>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue