Browse Source

采购退货 2023年1月28日 sxm

master
[li_she] 3 years ago
parent
commit
1f8b9c4ec7
  1. 3
      src/main/java/com/gaotao/modules/finishedProduct/service/impl/TransheaderServiceImpl.java
  2. 12
      src/main/java/com/gaotao/modules/pda/controller/HomeController.java
  3. 58
      src/main/java/com/gaotao/modules/pda/controller/PurchaseReturnController.java
  4. 26
      src/main/java/com/gaotao/modules/pda/service/PurchaseReturnService.java
  5. 60
      src/main/java/com/gaotao/modules/pda/service/impl/PurchaseReturnServiceImpl.java

3
src/main/java/com/gaotao/modules/finishedProduct/service/impl/TransheaderServiceImpl.java

@ -61,6 +61,9 @@ public class TransheaderServiceImpl extends ServiceImpl<TransheaderDao, Transhea
case "OC":
remark = "其它出库";
break;
case "CRR":
remark = "采购退货";
break;
}
herder.setRemark(remark);
this.save(herder);

12
src/main/java/com/gaotao/modules/pda/controller/HomeController.java

@ -421,4 +421,16 @@ public class HomeController {
return "/roll/roll_list";
}
// 采购退货 purchaseReturn
@GetMapping("purchaseSupplier")
public Object getPurchaseSupplier() {
return "/receipt/purchase_supplier";
}
// 采购退货 purchaseReturn
@GetMapping("purchaseReturn")
public Object getPurchaseReturn() {
return "/receipt/purchase_return";
}
}

58
src/main/java/com/gaotao/modules/pda/controller/PurchaseReturnController.java

@ -0,0 +1,58 @@
package com.gaotao.modules.pda.controller;
import com.gaotao.common.utils.R;
import com.gaotao.modules.finishedProduct.entity.CRollinfoEntity;
import com.gaotao.modules.pda.service.PurchaseReturnService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author lirui
* @ClassName: ReceiptController
* @Description: 控制扫描数据
* @date 2018年4月3日
*/
@RestController
@RequestMapping("/purchaseReturn")
public class PurchaseReturnController {
@Autowired
private PurchaseReturnService purchaseReturnService;
/**
* @param @param rollNo
* @param @return 参数
* @return Object 返回类型
* @throws
* @Title: scanRollNo
* @Description: 扫描卷号
* @author lirui
* @date 2018年4月4日
*/
@PostMapping(value = "/scanRollNo")
public R scanRollNo(@RequestBody CRollinfoEntity rollinfo) {
CRollinfoEntity cRollinfoEntity = purchaseReturnService.scanRollNo(rollinfo);
return R.ok().put("data", cRollinfoEntity);
}
/**
* @param []
* @author: sxm
* @description: 采购退货
* @return: com.gaotao.common.utils.R
* @date: 2023/1/27 13:39
*/
@PostMapping("returnGoods")
public R returnGoods(@RequestBody List<CRollinfoEntity> cRollinfoEntityList) {
purchaseReturnService.returnGoods(cRollinfoEntityList);
return R.ok("退货成功");
}
}

26
src/main/java/com/gaotao/modules/pda/service/PurchaseReturnService.java

@ -0,0 +1,26 @@
package com.gaotao.modules.pda.service;
import com.gaotao.modules.finishedProduct.entity.CRollinfoEntity;
import java.util.List;
/**
* @Classname PurchaseReturnService
* @Description TODO
* @Date 2023/1/25 12:09
* @Created by sxm
*/
public interface PurchaseReturnService {
CRollinfoEntity scanRollNo(CRollinfoEntity rollNo);
/**
* @author: sxm
* @description: 批量退货卷
* @param [cRollinfoEntityList]
* @return: void
* @date: 2023/1/27 13:53
*/
void returnGoods(List<CRollinfoEntity> cRollinfoEntityList);
}

60
src/main/java/com/gaotao/modules/pda/service/impl/PurchaseReturnServiceImpl.java

@ -0,0 +1,60 @@
package com.gaotao.modules.pda.service.impl;
import com.gaotao.common.exception.XJException;
import com.gaotao.modules.finishedProduct.entity.CRollinfoEntity;
import com.gaotao.modules.finishedProduct.service.CRollinfoService;
import com.gaotao.modules.finishedProduct.service.TransheaderService;
import com.gaotao.modules.pda.service.PurchaseReturnService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @Classname PurchaseReturnServiceImpl
* @Description TODO
* @Date 2023/1/25 12:09
* @Created by sxm
*/
@Service
public class PurchaseReturnServiceImpl implements PurchaseReturnService {
@Autowired
private CRollinfoService cRollinfoService;
@Autowired
private TransheaderService transheaderService;
@Override
public CRollinfoEntity scanRollNo(CRollinfoEntity rollNo) {
CRollinfoEntity cRollinfoEntity = cRollinfoService.infoRollno(rollNo);
if (cRollinfoEntity == null) {
throw new XJException("该卷不存在");
}
if ("D".equals(cRollinfoEntity.getStatusDb())) {
throw new XJException("该卷不在库");
}
if (!rollNo.getSupplierid().equals(cRollinfoEntity.getSupplierid())) {
throw new XJException("该卷不属于该供应商");
}
return cRollinfoEntity;
}
@Override
@Transactional
public void returnGoods(List<CRollinfoEntity> cRollinfoEntityList) {
// 修改卷状态
cRollinfoEntityList.forEach(rollInfo -> {
cRollinfoService.lambdaUpdate().set(CRollinfoEntity::getStatus, rollInfo.getStatus())
.set(CRollinfoEntity::getStatusDb, rollInfo.getStatusDb())
.set(StringUtils.isNotEmpty(rollInfo.getSynchronizedflag()), CRollinfoEntity::getSynchronizedflag, rollInfo.getSynchronizedflag())
.set(CRollinfoEntity::getNeedsynchronizeflag,"N")
.eq(StringUtils.isNotEmpty(rollInfo.getSite()), CRollinfoEntity::getSite, rollInfo.getSite())
.eq(CRollinfoEntity::getRollno, rollInfo.getRollno())
.update();
});
transheaderService.saveTransInfo(cRollinfoEntityList,"CRR");
}
}
Loading…
Cancel
Save