5 changed files with 159 additions and 0 deletions
-
3src/main/java/com/gaotao/modules/finishedProduct/service/impl/TransheaderServiceImpl.java
-
12src/main/java/com/gaotao/modules/pda/controller/HomeController.java
-
58src/main/java/com/gaotao/modules/pda/controller/PurchaseReturnController.java
-
26src/main/java/com/gaotao/modules/pda/service/PurchaseReturnService.java
-
60src/main/java/com/gaotao/modules/pda/service/impl/PurchaseReturnServiceImpl.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("退货成功"); |
|||
} |
|||
} |
|||
@ -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); |
|||
|
|||
} |
|||
@ -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"); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue