Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e9deecdee5
|
|
@ -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);
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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>
|
||||||
Loading…
Reference in New Issue