配置类定义
This commit is contained in:
parent
bd92d12d5c
commit
e4ff53d048
|
|
@ -106,25 +106,4 @@ public class MaterialConstants {
|
||||||
*/
|
*/
|
||||||
public static final Integer TEN_CONSTANT = 10;
|
public static final Integer TEN_CONSTANT = 10;
|
||||||
|
|
||||||
/**
|
|
||||||
* 已全部入库
|
|
||||||
*/
|
|
||||||
public static final Integer INVENTORY = 4;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 部分已入库
|
|
||||||
*/
|
|
||||||
public static final Integer PARTIALLY_WAREHOUSED = 9;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库审核中
|
|
||||||
*/
|
|
||||||
public static final Integer INBOUND_AUDIT = 5;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 入库审核未通过
|
|
||||||
*/
|
|
||||||
public static final Integer PURCHASE_STORAGE_NO_PASSED = 7;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class PurchaseBindController extends BaseController {
|
||||||
* 一级分页查询
|
* 一级分页查询
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "查询新购验收绑定详细列表")
|
@ApiOperation(value = "查询新购验收绑定详细列表")
|
||||||
//@RequiresPermissions("purchase:bind:list")
|
@RequiresPermissions("purchase:bind:list")
|
||||||
@GetMapping(value = "/list")
|
@GetMapping(value = "/list")
|
||||||
public TableDataInfo getList(PurchaseDto dto) {
|
public TableDataInfo getList(PurchaseDto dto) {
|
||||||
startPage();
|
startPage();
|
||||||
|
|
|
||||||
|
|
@ -44,16 +44,6 @@ public class PurchaseStorageController extends BaseController {
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取新购验收入库详细信息
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "获取新购验收入库详细信息")
|
|
||||||
@RequiresPermissions("purchase:storage:query")
|
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
public AjaxResult getInfo(@PathVariable("id") Long id) {
|
|
||||||
return AjaxResult.success(purchaseStorageService.selectPurchaseCheckInfoById(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取新购入库二级明细列表
|
* 获取新购入库二级明细列表
|
||||||
* @param
|
* @param
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,6 @@ public interface PurchaseStorageMapper {
|
||||||
*/
|
*/
|
||||||
List<PurchaseVo> selectAll(PurchaseDto dto);
|
List<PurchaseVo> selectAll(PurchaseDto dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询详情
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<PurchaseVo> selectPurchaseCheckInfoById(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询详情
|
* 查询详情
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
@ -40,7 +33,7 @@ public interface PurchaseStorageMapper {
|
||||||
* @param bindNum
|
* @param bindNum
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateNum(@Param("id") String purchaseId, @Param("purchaseNum") Integer bindNum);
|
int updateNum(@Param("id") String purchaseId, @Param("bindNum") Integer bindNum);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新状态
|
* 更新状态
|
||||||
|
|
|
||||||
|
|
@ -20,13 +20,6 @@ public interface IPurchaseStorageService {
|
||||||
*/
|
*/
|
||||||
List<PurchaseVo> selectAll(PurchaseDto dto);
|
List<PurchaseVo> selectAll(PurchaseDto dto);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
* @param id
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
List<PurchaseVo> selectPurchaseCheckInfoById(Long id);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询二级明细
|
* 查询二级明细
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
|
||||||
|
|
@ -245,10 +245,12 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (PurchaseVo purchaseVo : list) {
|
for (PurchaseVo purchaseVo : list) {
|
||||||
//更新状态为已驳回
|
//更新状态为已驳回
|
||||||
purchaseBindMapper.updateStatusById(MaterialConstants.SEVEN_CONSTANT, purchaseVo.getPurchaseId());
|
if (purchaseVo.getStatus().equals(MaterialConstants.THREE_CONSTANT) || purchaseVo.getStatus().equals(MaterialConstants.SEVEN_CONSTANT)) {
|
||||||
|
purchaseBindMapper.updateStatusById(MaterialConstants.SEVEN_CONSTANT, purchaseVo.getPurchaseId());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += tmTaskMapper.updateStatusById(MaterialConstants.FIVE_CONSTANT, dto.getTaskId());
|
result += tmTaskMapper.updateStatusById(MaterialConstants.TEN_CONSTANT, dto.getTaskId());
|
||||||
}
|
}
|
||||||
//二级页面驳回
|
//二级页面驳回
|
||||||
if (dto.getPurchaseId() != null) {
|
if (dto.getPurchaseId() != null) {
|
||||||
|
|
@ -262,8 +264,9 @@ public class PurchaseBindServiceImpl implements IPurchaseBindService {
|
||||||
List<PurchaseVo> list = purchaseBindMapper.getDetails(dto);
|
List<PurchaseVo> list = purchaseBindMapper.getDetails(dto);
|
||||||
if (CollectionUtils.isNotEmpty(list)) {
|
if (CollectionUtils.isNotEmpty(list)) {
|
||||||
for (PurchaseVo purchaseVo : list) {
|
for (PurchaseVo purchaseVo : list) {
|
||||||
dto.setTaskId(purchaseVo.getTaskId().toString());
|
PurchaseDto purchaseDto = new PurchaseDto();
|
||||||
List<PurchaseVo> voList = purchaseBindMapper.getDetails(dto);
|
purchaseDto.setTaskId(purchaseVo.getTaskId().toString());
|
||||||
|
List<PurchaseVo> voList = purchaseBindMapper.getDetails(purchaseDto);
|
||||||
result = getResult(result, voList);
|
result = getResult(result, voList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,9 @@ import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.core.web.domain.AjaxResult;
|
import com.bonus.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.material.ma.mapper.MachineMapper;
|
import com.bonus.material.ma.mapper.MachineMapper;
|
||||||
|
import com.bonus.material.purchase.config.RemoteConfig;
|
||||||
import com.bonus.material.purchase.dto.PurchaseDto;
|
import com.bonus.material.purchase.dto.PurchaseDto;
|
||||||
|
import com.bonus.material.purchase.mapper.PurchaseBindMapper;
|
||||||
import com.bonus.material.purchase.mapper.PurchaseStorageMapper;
|
import com.bonus.material.purchase.mapper.PurchaseStorageMapper;
|
||||||
import com.bonus.material.purchase.service.IPurchaseStorageService;
|
import com.bonus.material.purchase.service.IPurchaseStorageService;
|
||||||
import com.bonus.material.purchase.vo.PurchaseVo;
|
import com.bonus.material.purchase.vo.PurchaseVo;
|
||||||
|
|
@ -36,9 +38,15 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
@Resource
|
@Resource
|
||||||
private MachineMapper machineMapper;
|
private MachineMapper machineMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private PurchaseBindMapper purchaseBindMapper;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private TmTaskMapper tmTaskMapper;
|
private TmTaskMapper tmTaskMapper;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RemoteConfig remoteConfig;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有
|
* 查询所有
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
@ -47,17 +55,21 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
@Override
|
@Override
|
||||||
public List<PurchaseVo> selectAll(PurchaseDto dto) {
|
public List<PurchaseVo> selectAll(PurchaseDto dto) {
|
||||||
List<PurchaseVo> list = purchaseStorageMapper.selectAll(dto);
|
List<PurchaseVo> list = purchaseStorageMapper.selectAll(dto);
|
||||||
|
extracted(list);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询详情
|
* 远程调用方法抽取
|
||||||
* @param id
|
* @param list
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
@Override
|
private void extracted(List<PurchaseVo> list) {
|
||||||
public List<PurchaseVo> selectPurchaseCheckInfoById(Long id) {
|
for (PurchaseVo purchaseVo : list) {
|
||||||
return purchaseStorageMapper.selectPurchaseCheckInfoById(id);
|
String userName = remoteConfig.getUserName(purchaseVo.getCreateBy());
|
||||||
|
purchaseVo.setCreateBy(userName == null ? "" : userName);
|
||||||
|
String dictValue = remoteConfig.getDictValue("purchase_task_status", purchaseVo.getStatus().toString());
|
||||||
|
purchaseVo.setStatusName(dictValue == null ? "" : dictValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -67,7 +79,14 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<PurchaseVo> getDetails(PurchaseDto dto) {
|
public List<PurchaseVo> getDetails(PurchaseDto dto) {
|
||||||
return purchaseStorageMapper.getDetails(dto);
|
List<PurchaseVo> list = purchaseBindMapper.getDetails(dto);
|
||||||
|
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(list)) {
|
||||||
|
for (PurchaseVo purchaseVo : list) {
|
||||||
|
String name = remoteConfig.getDictValue("purchase_task_status", purchaseVo.getStatus().toString());
|
||||||
|
purchaseVo.setStatusName(name == null ? "" : name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -112,10 +131,10 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private AjaxResult rejectByPurchaseIds(PurchaseDto purchaseDto) {
|
private AjaxResult rejectByPurchaseIds(PurchaseDto purchaseDto) {
|
||||||
purchaseDto.setStatus(MaterialConstants.PURCHASE_STORAGE_NO_PASSED);
|
purchaseDto.setStatus(MaterialConstants.EIGHT_CONSTANT);
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
List<PurchaseVo> details = purchaseStorageMapper.getDetails(purchaseDto);
|
List<PurchaseVo> details = purchaseBindMapper.getDetails(purchaseDto);
|
||||||
if (CollectionUtils.isNotEmpty(details)) {
|
if (CollectionUtils.isNotEmpty(details)) {
|
||||||
result += updateRejectAndStatus(Integer.parseInt(purchaseDto.getPurchaseId()));
|
result += updateRejectAndStatus(Integer.parseInt(purchaseDto.getPurchaseId()));
|
||||||
List<PurchaseVo> statusList = purchaseStorageMapper.select(details.get(0).getTaskId().toString());
|
List<PurchaseVo> statusList = purchaseStorageMapper.select(details.get(0).getTaskId().toString());
|
||||||
|
|
@ -136,7 +155,7 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int updateRejectAndStatus(int purchaseId) {
|
private int updateRejectAndStatus(int purchaseId) {
|
||||||
return purchaseStorageMapper.updateStatusById(MaterialConstants.PURCHASE_STORAGE_NO_PASSED, purchaseId);
|
return purchaseStorageMapper.updateStatusById(MaterialConstants.EIGHT_CONSTANT, purchaseId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -151,11 +170,13 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
for (Integer taskId : taskIdList) {
|
for (Integer taskId : taskIdList) {
|
||||||
dto.setTaskId(String.valueOf(taskId));
|
dto.setTaskId(String.valueOf(taskId));
|
||||||
List<PurchaseVo> details;
|
List<PurchaseVo> details;
|
||||||
details = purchaseStorageMapper.getDetails(dto);
|
details = purchaseBindMapper.getDetails(dto);
|
||||||
for (PurchaseVo purchaseVo : details) {
|
for (PurchaseVo purchaseVo : details) {
|
||||||
result += purchaseStorageMapper.updateStatusById(MaterialConstants.PURCHASE_STORAGE_NO_PASSED, Integer.parseInt(purchaseVo.getPurchaseId()));
|
if (purchaseVo.getStatus().equals(MaterialConstants.EIGHT_CONSTANT) || purchaseVo.getStatus().equals(MaterialConstants.FOUR_CONSTANT)) {
|
||||||
|
result += purchaseStorageMapper.updateStatusById(MaterialConstants.EIGHT_CONSTANT, Integer.parseInt(purchaseVo.getPurchaseId()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
details = purchaseStorageMapper.getDetails(dto);
|
details = purchaseBindMapper.getDetails(dto);
|
||||||
result += updateTaskStatus(details);
|
result += updateTaskStatus(details);
|
||||||
}
|
}
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
|
@ -173,10 +194,10 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private AjaxResult processByPurchaseIds(PurchaseDto purchaseDto) {
|
private AjaxResult processByPurchaseIds(PurchaseDto purchaseDto) {
|
||||||
purchaseDto.setStatus(MaterialConstants.INVENTORY);
|
purchaseDto.setStatus(MaterialConstants.FIVE_CONSTANT);
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
List<PurchaseVo> details = purchaseStorageMapper.getDetails(purchaseDto);
|
List<PurchaseVo> details = purchaseBindMapper.getDetails(purchaseDto);
|
||||||
if (CollectionUtils.isNotEmpty(details)) {
|
if (CollectionUtils.isNotEmpty(details)) {
|
||||||
result += updatePurchaseInfoAndDetails(details.get(0), Integer.parseInt(purchaseDto.getPurchaseId()));
|
result += updatePurchaseInfoAndDetails(details.get(0), Integer.parseInt(purchaseDto.getPurchaseId()));
|
||||||
List<PurchaseVo> statusList = purchaseStorageMapper.select(details.get(0).getTaskId().toString());
|
List<PurchaseVo> statusList = purchaseStorageMapper.select(details.get(0).getTaskId().toString());
|
||||||
|
|
@ -198,7 +219,7 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private int updatePurchaseInfoAndDetails(PurchaseVo detail, int purchaseId) {
|
private int updatePurchaseInfoAndDetails(PurchaseVo detail, int purchaseId) {
|
||||||
int result = purchaseStorageMapper.updateStatusById(MaterialConstants.INVENTORY, purchaseId);
|
int result = purchaseStorageMapper.updateStatusById(MaterialConstants.FIVE_CONSTANT, purchaseId);
|
||||||
if (ZERO_CONSTANT.equals(detail.getManageType())) {
|
if (ZERO_CONSTANT.equals(detail.getManageType())) {
|
||||||
result += purchaseStorageMapper.insertMachine(detail);
|
result += purchaseStorageMapper.insertMachine(detail);
|
||||||
} else if (ONE_CONSTANT.equals(detail.getManageType())) {
|
} else if (ONE_CONSTANT.equals(detail.getManageType())) {
|
||||||
|
|
@ -219,9 +240,9 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
for (Integer taskId : taskIdList) {
|
for (Integer taskId : taskIdList) {
|
||||||
dto.setTaskId(String.valueOf(taskId));
|
dto.setTaskId(String.valueOf(taskId));
|
||||||
List<PurchaseVo> details;
|
List<PurchaseVo> details;
|
||||||
details = purchaseStorageMapper.getDetails(dto);
|
details = purchaseBindMapper.getDetails(dto);
|
||||||
result += updateDetailsAndStatus(details);
|
result += updateDetailsAndStatus(details);
|
||||||
details = purchaseStorageMapper.getDetails(dto);
|
details = purchaseBindMapper.getDetails(dto);
|
||||||
result += updateTaskStatus(details);
|
result += updateTaskStatus(details);
|
||||||
}
|
}
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
|
@ -242,7 +263,7 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
return details.stream()
|
return details.stream()
|
||||||
.mapToInt(detail -> {
|
.mapToInt(detail -> {
|
||||||
int result = purchaseStorageMapper.updateNum(detail.getPurchaseId(), detail.getBindNum());
|
int result = purchaseStorageMapper.updateNum(detail.getPurchaseId(), detail.getBindNum());
|
||||||
result += purchaseStorageMapper.updateStatusById(MaterialConstants.INVENTORY, Integer.parseInt(detail.getPurchaseId()));
|
result += purchaseStorageMapper.updateStatusById(MaterialConstants.FIVE_CONSTANT, Integer.parseInt(detail.getPurchaseId()));
|
||||||
if (ZERO_CONSTANT.equals(detail.getManageType())) {
|
if (ZERO_CONSTANT.equals(detail.getManageType())) {
|
||||||
result += purchaseStorageMapper.insertMachine(detail);
|
result += purchaseStorageMapper.insertMachine(detail);
|
||||||
} else if (ONE_CONSTANT.equals(detail.getManageType())) {
|
} else if (ONE_CONSTANT.equals(detail.getManageType())) {
|
||||||
|
|
@ -268,11 +289,11 @@ public class PurchaseStorageServiceImpl implements IPurchaseStorageService {
|
||||||
.mapToInt(entry -> {
|
.mapToInt(entry -> {
|
||||||
Integer id = entry.getKey();
|
Integer id = entry.getKey();
|
||||||
List<Integer> statusList = entry.getValue();
|
List<Integer> statusList = entry.getValue();
|
||||||
if (statusList.contains(MaterialConstants.INBOUND_AUDIT) || statusList.contains(MaterialConstants.PURCHASE_STORAGE_NO_PASSED)) {
|
if (statusList.contains(MaterialConstants.FOUR_CONSTANT) || statusList.contains(MaterialConstants.EIGHT_CONSTANT)) {
|
||||||
return tmTaskMapper.updateStatusById(MaterialConstants.NINE_CONSTANT, id.toString());
|
return tmTaskMapper.updateStatusById(MaterialConstants.TEN_CONSTANT, id.toString());
|
||||||
} else if (!statusList.contains(MaterialConstants.INBOUND_AUDIT) && !statusList.contains(MaterialConstants.PURCHASE_STORAGE_NO_PASSED)
|
} else if (!statusList.contains(MaterialConstants.FOUR_CONSTANT) && !statusList.contains(MaterialConstants.EIGHT_CONSTANT)
|
||||||
&& !statusList.contains(MaterialConstants.PARTIALLY_WAREHOUSED) && statusList.contains(MaterialConstants.INVENTORY)) {
|
&& statusList.contains(MaterialConstants.FIVE_CONSTANT)) {
|
||||||
return tmTaskMapper.updateStatusById(MaterialConstants.FOUR_CONSTANT, id.toString());
|
return tmTaskMapper.updateStatusById(MaterialConstants.FIVE_CONSTANT, id.toString());
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}).sum();
|
}).sum();
|
||||||
|
|
|
||||||
|
|
@ -5,12 +5,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<mapper namespace="com.bonus.material.purchase.mapper.PurchaseStorageMapper">
|
<mapper namespace="com.bonus.material.purchase.mapper.PurchaseStorageMapper">
|
||||||
|
|
||||||
<insert id="insertMachine">
|
<insert id="insertMachine">
|
||||||
|
insert into ma_machine
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="maCode != null">ma_code,</if>
|
||||||
|
<if test="preCode != null">pre_code,</if>
|
||||||
|
<if test="maStatus != null">ma_status,</if>
|
||||||
|
<if test="qrCode != null">qr_code,</if>
|
||||||
|
<if test="buyPrice != null">buy_price,</if>
|
||||||
|
<if test="maVender != null">ma_vender,</if>
|
||||||
|
<if test="outFacTime != null">out_fac_time,</if>
|
||||||
|
<if test="outFacCode != null">out_fac_code,</if>
|
||||||
|
<if test="assetsCode != null">assets_code,</if>
|
||||||
|
<if test="checkMan != null">check_man,</if>
|
||||||
|
<if test="thisCheckTime != null">this_check_time,</if>
|
||||||
|
<if test="nextCheckTime != null">next_check_time,</if>
|
||||||
|
<if test="gpsCode != null">gps_code,</if>
|
||||||
|
<if test="rfidCode != null">rfid_code,</if>
|
||||||
|
<if test="erpCode != null">erp_code,</if>
|
||||||
|
<if test="transferCode != null">transfer_code,</if>
|
||||||
|
<if test="inOutNum != null">in_out_num,</if>
|
||||||
|
<if test="buyTask != null">buy_task,</if>
|
||||||
|
<if test="ownHouse != null">own_house,</if>
|
||||||
|
<if test="companyId != null">company_id,</if>
|
||||||
|
create_time,
|
||||||
|
<if test="inspectMan != null">inspect_man,</if>
|
||||||
|
<if test="inspectStatus != null">inspect_status,</if>
|
||||||
|
<if test="phone != null">phone,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="maCode != null">#{maCode},</if>
|
||||||
|
<if test="preCode != null">#{preCode},</if>
|
||||||
|
<if test="maStatus != null">#{maStatus},</if>
|
||||||
|
<if test="qrCode != null">#{qrCode},</if>
|
||||||
|
<if test="buyPrice != null">#{buyPrice},</if>
|
||||||
|
<if test="maVender != null">#{maVender},</if>
|
||||||
|
<if test="outFacTime != null">#{outFacTime},</if>
|
||||||
|
<if test="outFacCode != null">#{outFacCode},</if>
|
||||||
|
<if test="assetsCode != null">#{assetsCode},</if>
|
||||||
|
<if test="checkMan != null">#{checkMan},</if>
|
||||||
|
<if test="thisCheckTime != null">#{thisCheckTime},</if>
|
||||||
|
<if test="nextCheckTime != null">#{nextCheckTime},</if>
|
||||||
|
<if test="gpsCode != null">#{gpsCode},</if>
|
||||||
|
<if test="rfidCode != null">#{rfidCode},</if>
|
||||||
|
<if test="erpCode != null">#{erpCode},</if>
|
||||||
|
<if test="transferCode != null">#{transferCode},</if>
|
||||||
|
<if test="inOutNum != null">#{inOutNum},</if>
|
||||||
|
<if test="buyTask != null">#{buyTask},</if>
|
||||||
|
<if test="ownHouse != null">#{ownHouse},</if>
|
||||||
|
<if test="companyId != null">#{companyId},</if>
|
||||||
|
now(),
|
||||||
|
<if test="inspectMan != null">#{inspectMan},</if>
|
||||||
|
<if test="inspectStatus != null">#{inspectStatus},</if>
|
||||||
|
<if test="phone != null">#{phone},</if>
|
||||||
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<update id="updateNum">
|
<update id="updateNum">
|
||||||
UPDATE purchase_check_details
|
UPDATE purchase_check_details
|
||||||
SET input_num = #{purchaseNum},
|
SET input_num = #{bindNum},
|
||||||
input_time = now()
|
input_time = now()
|
||||||
WHERE
|
WHERE
|
||||||
id = #{id}
|
id = #{id}
|
||||||
|
|
@ -66,29 +120,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
pci.arrival_time DESC
|
pci.arrival_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectPurchaseCheckInfoById" resultType="com.bonus.material.purchase.vo.PurchaseVo">
|
|
||||||
SELECT
|
|
||||||
pci.task_id as taskId,
|
|
||||||
mt1.type_name AS materialName,
|
|
||||||
mt.type_name AS materialModel,
|
|
||||||
pcd.check_num AS purchaseNum,
|
|
||||||
pcd.check_num AS checkNum,
|
|
||||||
pcd.bind_num AS bindNum,
|
|
||||||
mt.unit_name AS unitName,
|
|
||||||
pcd.type_id as typeId,
|
|
||||||
ms.supplier AS supplierName,
|
|
||||||
pcd.production_time AS productDate,
|
|
||||||
mt.manage_type as manageType,
|
|
||||||
pcd.`status` as STATUS
|
|
||||||
FROM
|
|
||||||
purchase_check_info pci
|
|
||||||
LEFT JOIN tm_task tt ON pci.task_id = tt.task_id
|
|
||||||
LEFT JOIN purchase_check_details pcd ON pci.task_id = pcd.task_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_supplier_info ms ON pcd.supplier_id = ms.supplier_id
|
|
||||||
where pci.task_id = #{id}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="getDetails" resultType="com.bonus.material.purchase.vo.PurchaseVo">
|
<select id="getDetails" resultType="com.bonus.material.purchase.vo.PurchaseVo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -128,6 +159,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="purchaseId != null">
|
<if test="purchaseId != null">
|
||||||
AND pcd.id = #{purchaseId}
|
AND pcd.id = #{purchaseId}
|
||||||
</if>
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
pcd.type_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="select" resultType="com.bonus.material.purchase.vo.PurchaseVo">
|
<select id="select" resultType="com.bonus.material.purchase.vo.PurchaseVo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue