|
|
|
@ -73,8 +73,8 @@ import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
*
|
|
|
|
|
* purchaseorder
|
|
|
|
|
*
|
|
|
|
|
* @版本: V3.2.0
|
|
|
|
|
* @版权: LINKAGE-BOOT
|
|
|
|
|
* @作者: LINKAGE-BOOT研发团队
|
|
|
|
@ -82,7 +82,7 @@ import java.util.Map;
|
|
|
|
|
*/
|
|
|
|
|
@Slf4j
|
|
|
|
|
@RestController
|
|
|
|
|
@Api(tags = "purchaseorder" , value = "purchaseorder")
|
|
|
|
|
@Api(tags = "purchaseorder", value = "purchaseorder")
|
|
|
|
|
@RequestMapping("/api/purchaseorder/Purchaseorder")
|
|
|
|
|
public class PurchaseorderController {
|
|
|
|
|
|
|
|
|
@ -145,7 +145,7 @@ public class PurchaseorderController {
|
|
|
|
|
@Transactional
|
|
|
|
|
public ActionResult pigeonhole(@RequestBody PigeonholeModel pigeonholeModel) {
|
|
|
|
|
PurchaseorderitemEntity purchaseorder = purchaseorderitemService.getById(pigeonholeModel.getId());
|
|
|
|
|
if (purchaseorder.getInvoiceAmount().equals(purchaseorder.getAmount()) && purchaseorder.getInvoiceAmount().equals(purchaseorder.getPayPrice())){
|
|
|
|
|
if (purchaseorder.getInvoiceAmount().equals(purchaseorder.getAmount()) && purchaseorder.getInvoiceAmount().equals(purchaseorder.getPayPrice())) {
|
|
|
|
|
purchaseorder.setStatus("3");
|
|
|
|
|
purchaseorderitemService.updateById(purchaseorder);
|
|
|
|
|
List<PoundlistEntity> poundlistEntityList = purchaseorderitemService.getPoundList(purchaseorder.getId());
|
|
|
|
@ -154,7 +154,7 @@ public class PurchaseorderController {
|
|
|
|
|
poundlistService.updateById(poundlistEntity);
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success("归档成功!");
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
return ActionResult.fail("发票金额、金额、已付款金额三者不一致!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -171,18 +171,18 @@ public class PurchaseorderController {
|
|
|
|
|
String[] idList = ids.split(",");
|
|
|
|
|
String supplier = "";
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (String id : idList){
|
|
|
|
|
for (String id : idList) {
|
|
|
|
|
PurchaseorderEntity purchaseorderEntity = purchaseorderService.getById(id);
|
|
|
|
|
if (!purchaseorderEntity.getStatus().equals("2")){
|
|
|
|
|
if (!purchaseorderEntity.getStatus().equals("2")) {
|
|
|
|
|
return ActionResult.fail("请先完成入库操作");
|
|
|
|
|
}
|
|
|
|
|
if (purchaseorderEntity.getPayPrice().equals(purchaseorderEntity.getAmount())){
|
|
|
|
|
if (purchaseorderEntity.getPayPrice().equals(purchaseorderEntity.getAmount())) {
|
|
|
|
|
return ActionResult.fail("已完成付款");
|
|
|
|
|
}
|
|
|
|
|
if (!purchaseorderEntity.getInvoiceAmount().equals(purchaseorderEntity.getAmount())){
|
|
|
|
|
if (!purchaseorderEntity.getInvoiceAmount().equals(purchaseorderEntity.getAmount())) {
|
|
|
|
|
return ActionResult.fail("请先开具发票");
|
|
|
|
|
}
|
|
|
|
|
if (i>0 && !supplier.equals(purchaseorderEntity.getSupplierName())){
|
|
|
|
|
if (i > 0 && !supplier.equals(purchaseorderEntity.getSupplierName())) {
|
|
|
|
|
return ActionResult.fail("存在多个不同供应商,请重新勾选");
|
|
|
|
|
}
|
|
|
|
|
supplier = purchaseorderEntity.getSupplierName();
|
|
|
|
@ -198,8 +198,8 @@ public class PurchaseorderController {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@PostMapping("/getList")
|
|
|
|
|
public ActionResult list(@RequestBody PurchaseorderPagination purchaseorderPagination)throws IOException{
|
|
|
|
|
List<PurchaseorderitemEntity> list= purchaseorderitemService.getList(purchaseorderPagination);
|
|
|
|
|
public ActionResult list(@RequestBody PurchaseorderPagination purchaseorderPagination) throws IOException {
|
|
|
|
|
List<PurchaseorderitemEntity> list = purchaseorderitemService.getList(purchaseorderPagination);
|
|
|
|
|
//处理id字段转名称,若无需转或者为空可删除
|
|
|
|
|
/*for(PurchaseorderitemEntity entity:list){
|
|
|
|
|
Map<String,Object> contractCodeMap = new HashMap<>();
|
|
|
|
@ -211,12 +211,12 @@ public class PurchaseorderController {
|
|
|
|
|
|
|
|
|
|
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
|
|
|
|
|
}*/
|
|
|
|
|
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
|
|
|
|
|
for(PurchaseorderListVO purchaseorderVO:listVO){
|
|
|
|
|
List<PurchaseorderListVO> listVO = JsonUtil.getJsonToList(list, PurchaseorderListVO.class);
|
|
|
|
|
for (PurchaseorderListVO purchaseorderVO : listVO) {
|
|
|
|
|
}
|
|
|
|
|
PageListVO vo=new PageListVO();
|
|
|
|
|
PageListVO vo = new PageListVO();
|
|
|
|
|
vo.setList(listVO);
|
|
|
|
|
PaginationVO page=JsonUtil.getJsonToBean(purchaseorderPagination,PaginationVO.class);
|
|
|
|
|
PaginationVO page = JsonUtil.getJsonToBean(purchaseorderPagination, PaginationVO.class);
|
|
|
|
|
vo.setPagination(page);
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|
}
|
|
|
|
@ -231,8 +231,8 @@ public class PurchaseorderController {
|
|
|
|
|
@PostMapping
|
|
|
|
|
@Transactional
|
|
|
|
|
public ActionResult create(@RequestBody @Valid PurchaseorderCrForm purchaseorderCrForm) throws DataException {
|
|
|
|
|
String mainId =RandomUtil.uuId();
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
String mainId = RandomUtil.uuId();
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
purchaseorderCrForm.setDocumentNo(generaterSwapUtil.getBillNumber("cgdj", false));
|
|
|
|
|
purchaseorderCrForm.setCreatorUserName(userInfo.getUserId());
|
|
|
|
|
purchaseorderCrForm.setCreatorTime(DateUtil.getNow());
|
|
|
|
@ -243,8 +243,8 @@ public class PurchaseorderController {
|
|
|
|
|
PurchaseorderitemEntity entity = JsonUtil.getJsonToBean(purchaseorderCrForm, PurchaseorderitemEntity.class);
|
|
|
|
|
entity.setId(mainId);
|
|
|
|
|
purchaseorderitemService.save(entity);
|
|
|
|
|
List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderCrForm.getPurchaseorder_item0List(),Purchaseorder_item0Entity.class);
|
|
|
|
|
for(Purchaseorder_item0Entity entitys : Purchaseorder_item0List){
|
|
|
|
|
List<Purchaseorder_item0Entity> Purchaseorder_item0List = JsonUtil.getJsonToList(purchaseorderCrForm.getPurchaseorder_item0List(), Purchaseorder_item0Entity.class);
|
|
|
|
|
for (Purchaseorder_item0Entity entitys : Purchaseorder_item0List) {
|
|
|
|
|
entitys.setId(RandomUtil.uuId());
|
|
|
|
|
entitys.setPurchaseorderId(entity.getId());
|
|
|
|
|
purchaseorder_item0Service.save(entitys);
|
|
|
|
@ -286,7 +286,6 @@ public class PurchaseorderController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 模板下载
|
|
|
|
|
*
|
|
|
|
@ -294,14 +293,14 @@ public class PurchaseorderController {
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("模板下载")
|
|
|
|
|
@GetMapping("/templateDownload")
|
|
|
|
|
public ActionResult<DownloadVO> TemplateDownload(){
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
DownloadVO vo=DownloadVO.builder().build();
|
|
|
|
|
try{
|
|
|
|
|
public ActionResult<DownloadVO> TemplateDownload() {
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
DownloadVO vo = DownloadVO.builder().build();
|
|
|
|
|
try {
|
|
|
|
|
vo.setName("职员信息.xlsx");
|
|
|
|
|
vo.setUrl(UploaderUtil.uploaderFile("/api/Common/DownloadModel?encryption=" ,userInfo.getId()+"#"+"职员信息.xlsx"+"#"+"Temporary"));
|
|
|
|
|
}catch(Exception e){
|
|
|
|
|
log.error("信息导出Excel错误:{}" ,e.getMessage());
|
|
|
|
|
vo.setUrl(UploaderUtil.uploaderFile("/api/Common/DownloadModel?encryption=", userInfo.getId() + "#" + "职员信息.xlsx" + "#" + "Temporary"));
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("信息导出Excel错误:{}", e.getMessage());
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|
}
|
|
|
|
@ -313,27 +312,26 @@ public class PurchaseorderController {
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("上传文件")
|
|
|
|
|
@PostMapping("/Uploader")
|
|
|
|
|
public ActionResult Uploader() throws Exception {
|
|
|
|
|
public ActionResult Uploader() throws Exception {
|
|
|
|
|
List<MultipartFile> list = UpUtil.getFileAll();
|
|
|
|
|
MultipartFile file = list.get(0);
|
|
|
|
|
if (file.getOriginalFilename().endsWith(".zip" )) {
|
|
|
|
|
String filePath = configValueUtil.getTemporaryFilePath()+"unzip\\";
|
|
|
|
|
if (file.getOriginalFilename().endsWith(".zip")) {
|
|
|
|
|
String filePath = configValueUtil.getTemporaryFilePath() + "unzip\\";
|
|
|
|
|
// String fileName = RandomUtil.uuId() + "." + UpUtil.getFileType(file);
|
|
|
|
|
// fileName = XSSEscape.escape(fileName);
|
|
|
|
|
//上传文件
|
|
|
|
|
File temporaryFile = new File(filePath);
|
|
|
|
|
if (!temporaryFile.exists()){
|
|
|
|
|
if (!temporaryFile.exists()) {
|
|
|
|
|
temporaryFile.mkdirs();
|
|
|
|
|
}
|
|
|
|
|
@Cleanup InputStream inputStream = file.getInputStream();
|
|
|
|
|
File gbk = ZipUtil.unzip(inputStream, temporaryFile, Charset.forName("GBK"));
|
|
|
|
|
HashMap<String, String> imgMap = new HashMap<>();
|
|
|
|
|
String fileName = FileCopy.getInfoAndUpFile(gbk.listFiles());
|
|
|
|
|
log.warn(filePath);
|
|
|
|
|
log.warn(fileName);
|
|
|
|
|
List<Object> resultList= FileCopy.getInfoAndUpFile(gbk.listFiles());
|
|
|
|
|
FileUtil.deleteFileAll(temporaryFile);
|
|
|
|
|
// FileUtil.upFile(file, filePath, fileName);
|
|
|
|
|
DownloadVO vo = DownloadVO.builder().build();
|
|
|
|
|
vo.setName(fileName);
|
|
|
|
|
vo.setName(String.valueOf(resultList.get(0)));
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|
} else {
|
|
|
|
|
return ActionResult.fail("选择文件不符合导入");
|
|
|
|
@ -376,92 +374,93 @@ public class PurchaseorderController {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 导出Excel
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
* 导出Excel
|
|
|
|
|
*
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@ApiOperation("导出Excel")
|
|
|
|
|
@GetMapping("/Actions/Export")
|
|
|
|
|
public ActionResult Export(PurchaseorderPaginationExportModel purchaseorderPaginationExportModel) throws IOException {
|
|
|
|
|
if (StringUtil.isEmpty(purchaseorderPaginationExportModel.getSelectKey())){
|
|
|
|
|
if (StringUtil.isEmpty(purchaseorderPaginationExportModel.getSelectKey())) {
|
|
|
|
|
return ActionResult.fail("请选择导出字段");
|
|
|
|
|
}
|
|
|
|
|
PurchaseorderPagination purchaseorderPagination=JsonUtil.getJsonToBean(purchaseorderPaginationExportModel, PurchaseorderPagination.class);
|
|
|
|
|
List<PurchaseorderitemEntity> list= purchaseorderitemService.getTypeList(purchaseorderPagination,purchaseorderPaginationExportModel.getDataType());
|
|
|
|
|
PurchaseorderPagination purchaseorderPagination = JsonUtil.getJsonToBean(purchaseorderPaginationExportModel, PurchaseorderPagination.class);
|
|
|
|
|
List<PurchaseorderitemEntity> list = purchaseorderitemService.getTypeList(purchaseorderPagination, purchaseorderPaginationExportModel.getDataType());
|
|
|
|
|
//处理id字段转名称,若无需转或者为空可删除
|
|
|
|
|
for(PurchaseorderitemEntity entity:list){
|
|
|
|
|
Map<String,Object> contractNameMap = new HashMap<>();
|
|
|
|
|
entity.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","contract_name","contract_name",entity.getContractName(),contractNameMap));
|
|
|
|
|
for (PurchaseorderitemEntity entity : list) {
|
|
|
|
|
Map<String, Object> contractNameMap = new HashMap<>();
|
|
|
|
|
entity.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229", "contract_name", "contract_name", entity.getContractName(), contractNameMap));
|
|
|
|
|
entity.setCreatorUserName(generaterSwapUtil.userSelectValue(entity.getCreatorUserName()));
|
|
|
|
|
}
|
|
|
|
|
List<PurchaseorderListVO> listVO=JsonUtil.getJsonToList(list,PurchaseorderListVO.class);
|
|
|
|
|
for(PurchaseorderListVO purchaseorderVO:listVO){
|
|
|
|
|
List<PurchaseorderListVO> listVO = JsonUtil.getJsonToList(list, PurchaseorderListVO.class);
|
|
|
|
|
for (PurchaseorderListVO purchaseorderVO : listVO) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//转换为map输出
|
|
|
|
|
List<Map<String, Object>>mapList=JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO,"yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
String[]keys=!StringUtil.isEmpty(purchaseorderPaginationExportModel.getSelectKey())?purchaseorderPaginationExportModel.getSelectKey().split(","):new String[0];
|
|
|
|
|
UserInfo userInfo=userProvider.get();
|
|
|
|
|
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),mapList,keys,userInfo);
|
|
|
|
|
List<Map<String, Object>> mapList = JsonUtil.getJsonToListMap(JsonUtil.getObjectToStringDateFormat(listVO, "yyyy-MM-dd HH:mm:ss"));
|
|
|
|
|
String[] keys = !StringUtil.isEmpty(purchaseorderPaginationExportModel.getSelectKey()) ? purchaseorderPaginationExportModel.getSelectKey().split(",") : new String[0];
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
DownloadVO vo = this.creatModelExcel(configValueUtil.getTemporaryFilePath(), mapList, keys, userInfo);
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//导出表格
|
|
|
|
|
public DownloadVO creatModelExcel(String path,List<Map<String, Object>>list,String[]keys,UserInfo userInfo){
|
|
|
|
|
DownloadVO vo=DownloadVO.builder().build();
|
|
|
|
|
List<ExcelExportEntity> entitys=new ArrayList<>();
|
|
|
|
|
if(keys.length>0){
|
|
|
|
|
for(String key:keys){
|
|
|
|
|
switch(key){
|
|
|
|
|
case "documentNo" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("单据编号" ,"documentNo"));
|
|
|
|
|
public DownloadVO creatModelExcel(String path, List<Map<String, Object>> list, String[] keys, UserInfo userInfo) {
|
|
|
|
|
DownloadVO vo = DownloadVO.builder().build();
|
|
|
|
|
List<ExcelExportEntity> entitys = new ArrayList<>();
|
|
|
|
|
if (keys.length > 0) {
|
|
|
|
|
for (String key : keys) {
|
|
|
|
|
switch (key) {
|
|
|
|
|
case "documentNo":
|
|
|
|
|
entitys.add(new ExcelExportEntity("单据编号", "documentNo"));
|
|
|
|
|
break;
|
|
|
|
|
case "contractName" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("合同名称" ,"contractName"));
|
|
|
|
|
case "contractName":
|
|
|
|
|
entitys.add(new ExcelExportEntity("合同名称", "contractName"));
|
|
|
|
|
break;
|
|
|
|
|
case "supplierName" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("供应商名称" ,"supplierName"));
|
|
|
|
|
case "supplierName":
|
|
|
|
|
entitys.add(new ExcelExportEntity("供应商名称", "supplierName"));
|
|
|
|
|
break;
|
|
|
|
|
case "currency" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("币种" ,"currency"));
|
|
|
|
|
case "currency":
|
|
|
|
|
entitys.add(new ExcelExportEntity("币种", "currency"));
|
|
|
|
|
break;
|
|
|
|
|
case "contractNo" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("对方合同号" ,"contractNo"));
|
|
|
|
|
case "contractNo":
|
|
|
|
|
entitys.add(new ExcelExportEntity("对方合同号", "contractNo"));
|
|
|
|
|
break;
|
|
|
|
|
case "advanceAmount" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("垫资金额" ,"advanceAmount"));
|
|
|
|
|
case "advanceAmount":
|
|
|
|
|
entitys.add(new ExcelExportEntity("垫资金额", "advanceAmount"));
|
|
|
|
|
break;
|
|
|
|
|
case "num" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("重量" ,"num"));
|
|
|
|
|
case "num":
|
|
|
|
|
entitys.add(new ExcelExportEntity("重量", "num"));
|
|
|
|
|
break;
|
|
|
|
|
case "amount" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("金额" ,"amount"));
|
|
|
|
|
case "amount":
|
|
|
|
|
entitys.add(new ExcelExportEntity("金额", "amount"));
|
|
|
|
|
break;
|
|
|
|
|
case "notAmount" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("不含税金额" ,"notAmount"));
|
|
|
|
|
case "notAmount":
|
|
|
|
|
entitys.add(new ExcelExportEntity("不含税金额", "notAmount"));
|
|
|
|
|
break;
|
|
|
|
|
case "remark" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("备注信息" ,"remark"));
|
|
|
|
|
case "remark":
|
|
|
|
|
entitys.add(new ExcelExportEntity("备注信息", "remark"));
|
|
|
|
|
break;
|
|
|
|
|
case "creatorUserName" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("制单人" ,"creatorUserName"));
|
|
|
|
|
case "creatorUserName":
|
|
|
|
|
entitys.add(new ExcelExportEntity("制单人", "creatorUserName"));
|
|
|
|
|
break;
|
|
|
|
|
case "creatorTime" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("制单时间" ,"creatorTime"));
|
|
|
|
|
case "creatorTime":
|
|
|
|
|
entitys.add(new ExcelExportEntity("制单时间", "creatorTime"));
|
|
|
|
|
break;
|
|
|
|
|
case "erpNo" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("ERP订单号" ,"erpNo"));
|
|
|
|
|
case "erpNo":
|
|
|
|
|
entitys.add(new ExcelExportEntity("ERP订单号", "erpNo"));
|
|
|
|
|
break;
|
|
|
|
|
case "payPrice" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("已付款金额" ,"payPrice"));
|
|
|
|
|
case "payPrice":
|
|
|
|
|
entitys.add(new ExcelExportEntity("已付款金额", "payPrice"));
|
|
|
|
|
break;
|
|
|
|
|
case "invoiceNum" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("发票数量" ,"invoiceNum"));
|
|
|
|
|
case "invoiceNum":
|
|
|
|
|
entitys.add(new ExcelExportEntity("发票数量", "invoiceNum"));
|
|
|
|
|
break;
|
|
|
|
|
case "invoiceAmount" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("发票金额" ,"invoiceAmount"));
|
|
|
|
|
case "invoiceAmount":
|
|
|
|
|
entitys.add(new ExcelExportEntity("发票金额", "invoiceAmount"));
|
|
|
|
|
break;
|
|
|
|
|
case "status" :
|
|
|
|
|
entitys.add(new ExcelExportEntity("单据状态 " ,"status"));
|
|
|
|
|
case "status":
|
|
|
|
|
entitys.add(new ExcelExportEntity("单据状态 ", "status"));
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
@ -471,9 +470,9 @@ public class PurchaseorderController {
|
|
|
|
|
|
|
|
|
|
ExportParams exportParams = new ExportParams(null, "表单信息");
|
|
|
|
|
exportParams.setType(ExcelType.XSSF);
|
|
|
|
|
try{
|
|
|
|
|
try {
|
|
|
|
|
@Cleanup Workbook workbook = new HSSFWorkbook();
|
|
|
|
|
if (entitys.size()>0){
|
|
|
|
|
if (entitys.size() > 0) {
|
|
|
|
|
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
|
|
|
|
|
}
|
|
|
|
|
String name = "表单信息" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
|
|
|
|
@ -502,14 +501,14 @@ public class PurchaseorderController {
|
|
|
|
|
*/
|
|
|
|
|
@DeleteMapping("/batchRemove/{ids}")
|
|
|
|
|
@Transactional
|
|
|
|
|
public ActionResult batchRemove(@PathVariable("ids") String ids){
|
|
|
|
|
public ActionResult batchRemove(@PathVariable("ids") String ids) {
|
|
|
|
|
String[] idList = ids.split(",");
|
|
|
|
|
int i =0;
|
|
|
|
|
for (String allId : idList){
|
|
|
|
|
int i = 0;
|
|
|
|
|
for (String allId : idList) {
|
|
|
|
|
this.delete(allId);
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
if (i == 0 ){
|
|
|
|
|
if (i == 0) {
|
|
|
|
|
return ActionResult.fail("删除失败");
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.success("删除成功");
|
|
|
|
@ -524,16 +523,16 @@ public class PurchaseorderController {
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/batchQueryPurchaseorder/{ids}")
|
|
|
|
|
@Transactional
|
|
|
|
|
public ActionResult<List<PurchaseorderitemEntity>> batchQueryPurchaseorder(@PathVariable("ids") String ids){
|
|
|
|
|
public ActionResult<List<PurchaseorderitemEntity>> batchQueryPurchaseorder(@PathVariable("ids") String ids) {
|
|
|
|
|
List<PurchaseorderitemEntity> list = new ArrayList<>();
|
|
|
|
|
String[] idList = ids.split(",");
|
|
|
|
|
for (String id: idList) {
|
|
|
|
|
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
|
|
|
|
|
for (String id : idList) {
|
|
|
|
|
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
|
|
|
|
|
List<PoundlistEntity> poundlistEntityList = purchaseorderitemService.getPoundList(id);
|
|
|
|
|
entity.setPoundlistEntityList(poundlistEntityList);
|
|
|
|
|
if(entity != null && StringUtils.isNotEmpty(entity.getContractCode())){
|
|
|
|
|
if (entity != null && StringUtils.isNotEmpty(entity.getContractCode())) {
|
|
|
|
|
ContractFileEntity contractFileEntity = contractFileService.getById(entity.getContractCode());
|
|
|
|
|
if(contractFileEntity != null && StringUtils.isNotEmpty(contractFileEntity.getContractName())){
|
|
|
|
|
if (contractFileEntity != null && StringUtils.isNotEmpty(contractFileEntity.getContractName())) {
|
|
|
|
|
entity.setContractNo(contractFileEntity.getContractCode());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -549,9 +548,9 @@ public class PurchaseorderController {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/{id}")
|
|
|
|
|
public ActionResult<PurchaseorderInfoVO> info(@PathVariable("id") String id){
|
|
|
|
|
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
|
|
|
|
|
PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
|
|
|
|
|
public ActionResult<PurchaseorderInfoVO> info(@PathVariable("id") String id) {
|
|
|
|
|
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
|
|
|
|
|
PurchaseorderInfoVO vo = JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
|
|
|
|
|
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
|
|
|
|
|
/*SupplierEntity supplierEntity = supplierService.getById(vo.getSupplierId());
|
|
|
|
|
if(supplierEntity != null){
|
|
|
|
@ -559,43 +558,40 @@ public class PurchaseorderController {
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(vo.getCreatorTime()!=null){
|
|
|
|
|
if (vo.getCreatorTime() != null) {
|
|
|
|
|
vo.setCreatorTime(vo.getCreatorTime());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//子表
|
|
|
|
|
List<Purchaseorder_item0Entity> Purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id);
|
|
|
|
|
for(Purchaseorder_item0Entity purchaseorder_item0Entity : Purchaseorder_item0List){
|
|
|
|
|
if(StringUtils.isNotEmpty(purchaseorder_item0Entity.getMaterialId())){
|
|
|
|
|
for (Purchaseorder_item0Entity purchaseorder_item0Entity : Purchaseorder_item0List) {
|
|
|
|
|
if (StringUtils.isNotEmpty(purchaseorder_item0Entity.getMaterialId())) {
|
|
|
|
|
MaterialEntity materialEntity = materialService.getById(purchaseorder_item0Entity.getMaterialId());
|
|
|
|
|
if(materialEntity != null){
|
|
|
|
|
if (materialEntity != null) {
|
|
|
|
|
purchaseorder_item0Entity.setMaterialName(materialEntity.getItemName());
|
|
|
|
|
if(StringUtils.isNotEmpty(materialEntity.getInArea())){
|
|
|
|
|
if (StringUtils.isNotEmpty(materialEntity.getInArea())) {
|
|
|
|
|
purchaseorder_item0Entity.setReservoirareaId(materialEntity.getInArea());
|
|
|
|
|
ReservoirareaEntity reservoirareaEntity = reservoirareaService.getById(materialEntity.getInArea());
|
|
|
|
|
if(reservoirareaEntity != null && StringUtils.isNotEmpty(reservoirareaEntity.getWarehouseId())){
|
|
|
|
|
if (reservoirareaEntity != null && StringUtils.isNotEmpty(reservoirareaEntity.getWarehouseId())) {
|
|
|
|
|
purchaseorder_item0Entity.setWarehouseId(reservoirareaEntity.getWarehouseId());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
vo.setPurchaseorder_item0List(JsonUtil.getJsonToList(Purchaseorder_item0List,Purchaseorder_item0Model.class ));
|
|
|
|
|
vo.setPurchaseorder_item0List(JsonUtil.getJsonToList(Purchaseorder_item0List, Purchaseorder_item0Model.class));
|
|
|
|
|
QueryWrapper<InvoicesitemEntity> invoicesitemWrapper = new QueryWrapper<>();
|
|
|
|
|
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId,id);
|
|
|
|
|
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId, id);
|
|
|
|
|
List<InvoicesitemEntity> invoicesitemList = invoicesitemService.list(invoicesitemWrapper);
|
|
|
|
|
List<Invoices_item0itemEntity> Invoices_item0itemList = new ArrayList<>();
|
|
|
|
|
for (InvoicesitemEntity invoicesitemEntity : invoicesitemList){
|
|
|
|
|
for (InvoicesitemEntity invoicesitemEntity : invoicesitemList) {
|
|
|
|
|
List<Invoices_item0itemEntity> invoices_item0itemList = purchaseorderitemService.GetInvoices_item0itemList(invoicesitemEntity.getId());
|
|
|
|
|
Invoices_item0itemList.addAll(invoices_item0itemList);
|
|
|
|
|
}
|
|
|
|
|
for(Invoices_item0itemEntity invoices_item0itemEntity : Invoices_item0itemList){
|
|
|
|
|
for (Invoices_item0itemEntity invoices_item0itemEntity : Invoices_item0itemList) {
|
|
|
|
|
}
|
|
|
|
|
vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList,Invoices_item0itemModel.class ));
|
|
|
|
|
if(invoicesitemList != null && invoicesitemList.size() > 0){
|
|
|
|
|
vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList, Invoices_item0itemModel.class));
|
|
|
|
|
if (invoicesitemList != null && invoicesitemList.size() > 0) {
|
|
|
|
|
vo.setInvoicesitemEntity(invoicesitemList.get(0));
|
|
|
|
|
}
|
|
|
|
|
List<PaymentListVO> paymentList = paymentService.queryByPurchaseorderId(id);
|
|
|
|
@ -605,9 +601,9 @@ public class PurchaseorderController {
|
|
|
|
|
List<PurchasebackEntity> PurchasebackList = purchasebackService.list(purchasebackWrapper);
|
|
|
|
|
vo.setPurchasebackList(PurchasebackList);
|
|
|
|
|
List<CollectionpoEntity> CollectionitemList = purchaseorderitemService.GetCollectionitemList(entity.getDocumentNo());
|
|
|
|
|
for(CollectionpoEntity collectionpoEntity : CollectionitemList){
|
|
|
|
|
for (CollectionpoEntity collectionpoEntity : CollectionitemList) {
|
|
|
|
|
}
|
|
|
|
|
vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList,CollectionitemModel.class ));
|
|
|
|
|
vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList, CollectionitemModel.class));
|
|
|
|
|
//副表
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|
}
|
|
|
|
@ -619,8 +615,8 @@ public class PurchaseorderController {
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("guidang/{id}")
|
|
|
|
|
public ActionResult<PurchaseorderInfoVO> guidang(@PathVariable("id") String id){
|
|
|
|
|
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
|
|
|
|
|
public ActionResult<PurchaseorderInfoVO> guidang(@PathVariable("id") String id) {
|
|
|
|
|
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
|
|
|
|
|
entity.setStatus("3");
|
|
|
|
|
purchaseorderitemService.updateById(entity);
|
|
|
|
|
return ActionResult.success("归档成功");
|
|
|
|
@ -634,58 +630,58 @@ public class PurchaseorderController {
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping("/detail/{id}")
|
|
|
|
|
public ActionResult<PurchaseorderInfoVO> detailInfo(@PathVariable("id") String id) throws IOException {
|
|
|
|
|
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
|
|
|
|
|
PurchaseorderInfoVO vo=JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
|
|
|
|
|
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
|
|
|
|
|
PurchaseorderInfoVO vo = JsonUtil.getJsonToBean(entity, PurchaseorderInfoVO.class);
|
|
|
|
|
|
|
|
|
|
//子表数据转换
|
|
|
|
|
List<Purchaseorder_item0Entity> jg_purchaseorder_item0List = purchaseorderitemService.GetPurchaseorder_item0List(id);
|
|
|
|
|
List<Purchaseorder_item0Model> jg_purchaseorder_item0ModelList = JsonUtil.getJsonToList(jg_purchaseorder_item0List,Purchaseorder_item0Model.class);
|
|
|
|
|
for(Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList){
|
|
|
|
|
Map<String,Object> vehicleIdMap = new HashMap<>();
|
|
|
|
|
jg_purchaseorder_item0Model.setVehicleName(generaterSwapUtil.getPopupSelectValue("389754644018016581","vehicle_id","ticketno",jg_purchaseorder_item0Model.getVehicleId(),vehicleIdMap));
|
|
|
|
|
Map<String,Object> materialIdMap = new HashMap<>();
|
|
|
|
|
jg_purchaseorder_item0Model.setMaterialName(generaterSwapUtil.getPopupSelectValue("397736371898382533","id","item_name",jg_purchaseorder_item0Model.getMaterialId(),materialIdMap));
|
|
|
|
|
List<Purchaseorder_item0Model> jg_purchaseorder_item0ModelList = JsonUtil.getJsonToList(jg_purchaseorder_item0List, Purchaseorder_item0Model.class);
|
|
|
|
|
for (Purchaseorder_item0Model jg_purchaseorder_item0Model : jg_purchaseorder_item0ModelList) {
|
|
|
|
|
Map<String, Object> vehicleIdMap = new HashMap<>();
|
|
|
|
|
jg_purchaseorder_item0Model.setVehicleName(generaterSwapUtil.getPopupSelectValue("389754644018016581", "vehicle_id", "ticketno", jg_purchaseorder_item0Model.getVehicleId(), vehicleIdMap));
|
|
|
|
|
Map<String, Object> materialIdMap = new HashMap<>();
|
|
|
|
|
jg_purchaseorder_item0Model.setMaterialName(generaterSwapUtil.getPopupSelectValue("397736371898382533", "id", "item_name", jg_purchaseorder_item0Model.getMaterialId(), materialIdMap));
|
|
|
|
|
PoundlistEntity poundlistEntity = poundlistService.getById(jg_purchaseorder_item0Model.getPoundlistId());
|
|
|
|
|
jg_purchaseorder_item0Model.setPoundDate(poundlistEntity.getPoundDate());
|
|
|
|
|
|
|
|
|
|
SupplierEntity supplierEntity = supplierService.getById(jg_purchaseorder_item0Model.getSupplierId());
|
|
|
|
|
if(supplierEntity != null){
|
|
|
|
|
if (supplierEntity != null) {
|
|
|
|
|
jg_purchaseorder_item0Model.setSupplierName(supplierEntity.getSupplierName());
|
|
|
|
|
}
|
|
|
|
|
UserEntity userEntity = userService.getById(poundlistEntity.getBusinessId());
|
|
|
|
|
if(userEntity != null){
|
|
|
|
|
if (userEntity != null) {
|
|
|
|
|
jg_purchaseorder_item0Model.setBusinessName(userEntity.getRealName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
vo.setPurchaseorder_item0List(jg_purchaseorder_item0ModelList);
|
|
|
|
|
List<Invoices_item0itemEntity> jg_invoices_item0List = purchaseorderitemService.GetInvoices_item0itemList(id);
|
|
|
|
|
List<Invoices_item0itemModel> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List,Invoices_item0itemModel.class);
|
|
|
|
|
for(Invoices_item0itemModel jg_invoices_item0Model : jg_invoices_item0ModelList){
|
|
|
|
|
}
|
|
|
|
|
vo.setInvoices_item0itemList(jg_invoices_item0ModelList);
|
|
|
|
|
List<Invoices_item0itemEntity> jg_invoices_item0List = purchaseorderitemService.GetInvoices_item0itemList(id);
|
|
|
|
|
List<Invoices_item0itemModel> jg_invoices_item0ModelList = JsonUtil.getJsonToList(jg_invoices_item0List, Invoices_item0itemModel.class);
|
|
|
|
|
for (Invoices_item0itemModel jg_invoices_item0Model : jg_invoices_item0ModelList) {
|
|
|
|
|
}
|
|
|
|
|
vo.setInvoices_item0itemList(jg_invoices_item0ModelList);
|
|
|
|
|
|
|
|
|
|
QueryWrapper<InvoicesitemEntity> invoicesitemWrapper = new QueryWrapper<>();
|
|
|
|
|
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId,id);
|
|
|
|
|
invoicesitemWrapper.lambda().eq(InvoicesitemEntity::getPurchaseorderId, id);
|
|
|
|
|
List<InvoicesitemEntity> invoicesitemList = invoicesitemService.list(invoicesitemWrapper);
|
|
|
|
|
List<Invoices_item0itemEntity> Invoices_item0itemList = new ArrayList<>();
|
|
|
|
|
for (InvoicesitemEntity invoicesitemEntity : invoicesitemList){
|
|
|
|
|
for (InvoicesitemEntity invoicesitemEntity : invoicesitemList) {
|
|
|
|
|
List<Invoices_item0itemEntity> invoices_item0itemList = purchaseorderitemService.GetInvoices_item0itemList(invoicesitemEntity.getId());
|
|
|
|
|
Invoices_item0itemList.addAll(invoices_item0itemList);
|
|
|
|
|
}
|
|
|
|
|
for(Invoices_item0itemEntity invoices_item0itemEntity : Invoices_item0itemList){
|
|
|
|
|
for (Invoices_item0itemEntity invoices_item0itemEntity : Invoices_item0itemList) {
|
|
|
|
|
}
|
|
|
|
|
vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList,Invoices_item0itemModel.class ));
|
|
|
|
|
vo.setInvoices_item0itemList(JsonUtil.getJsonToList(Invoices_item0itemList, Invoices_item0itemModel.class));
|
|
|
|
|
|
|
|
|
|
List<PaymentListVO> paymentList = paymentService.queryByPurchaseorderId(id);
|
|
|
|
|
vo.setPaymentList(paymentList);
|
|
|
|
|
|
|
|
|
|
List<Receiptin_item0Entity> receiptin_item0itemList = purchaseorderitemService.GetReceiptin_item0itemList(id);
|
|
|
|
|
List<Receiptin_item0Model> jg_receiptin_item0ModelList = JsonUtil.getJsonToList(receiptin_item0itemList,Receiptin_item0Model.class);
|
|
|
|
|
List<Receiptin_item0Model> jg_receiptin_item0ModelList = JsonUtil.getJsonToList(receiptin_item0itemList, Receiptin_item0Model.class);
|
|
|
|
|
vo.setReceiptin_item0List(jg_receiptin_item0ModelList);
|
|
|
|
|
QueryWrapper<ReceiptinEntity> receiptinWrapper = new QueryWrapper<>();
|
|
|
|
|
receiptinWrapper.lambda().eq(ReceiptinEntity::getSouceno, id);
|
|
|
|
|
ReceiptinEntity receiptinEntity = receiptinService.getOne(receiptinWrapper);
|
|
|
|
|
if(receiptinEntity != null){
|
|
|
|
|
if (receiptinEntity != null) {
|
|
|
|
|
vo.setReceiptamount(receiptinEntity.getReceiptamount());
|
|
|
|
|
vo.setReceiptnum(receiptinEntity.getReceiptnum());
|
|
|
|
|
}
|
|
|
|
@ -699,7 +695,7 @@ public class PurchaseorderController {
|
|
|
|
|
BigDecimal refundNum = new BigDecimal(0);
|
|
|
|
|
BigDecimal refundAmount = new BigDecimal(0);
|
|
|
|
|
List<Purchaseback_item0Entity> purchaseback_item0EntityList = new ArrayList<>();
|
|
|
|
|
for (PurchasebackEntity purchasebackEntity: PurchasebackList) {
|
|
|
|
|
for (PurchasebackEntity purchasebackEntity : PurchasebackList) {
|
|
|
|
|
refundNum = refundNum.add(purchasebackEntity.getRefundNum());
|
|
|
|
|
refundAmount = refundAmount.add(purchasebackEntity.getRefundAmount());
|
|
|
|
|
QueryWrapper<Purchaseback_item0Entity> purchasebackitem0Wrapper = new QueryWrapper<>();
|
|
|
|
@ -710,32 +706,30 @@ public class PurchaseorderController {
|
|
|
|
|
vo.setRefundAmount(refundAmount);
|
|
|
|
|
vo.setRefundNum(refundNum);
|
|
|
|
|
vo.setPurchaseback_item0EntityList(purchaseback_item0EntityList);
|
|
|
|
|
List<CollectionpoEntity> jg_collectionList = purchaseorderitemService.GetCollectionitemList(id);
|
|
|
|
|
List<CollectionitemModel> jg_collectionModelList = JsonUtil.getJsonToList(jg_collectionList,CollectionitemModel.class);
|
|
|
|
|
for(CollectionitemModel jg_collectionModel : jg_collectionModelList){
|
|
|
|
|
}
|
|
|
|
|
vo.setCollectionitemList(jg_collectionModelList);
|
|
|
|
|
List<CollectionpoEntity> jg_collectionList = purchaseorderitemService.GetCollectionitemList(id);
|
|
|
|
|
List<CollectionitemModel> jg_collectionModelList = JsonUtil.getJsonToList(jg_collectionList, CollectionitemModel.class);
|
|
|
|
|
for (CollectionitemModel jg_collectionModel : jg_collectionModelList) {
|
|
|
|
|
}
|
|
|
|
|
vo.setCollectionitemList(jg_collectionModelList);
|
|
|
|
|
|
|
|
|
|
List<CollectionpoEntity> CollectionitemList = purchaseorderitemService.GetCollectionitemList(entity.getDocumentNo());
|
|
|
|
|
for(CollectionpoEntity collectionpoEntity : CollectionitemList){
|
|
|
|
|
for (CollectionpoEntity collectionpoEntity : CollectionitemList) {
|
|
|
|
|
}
|
|
|
|
|
vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList,CollectionitemModel.class ));
|
|
|
|
|
vo.setCollectionitemList(JsonUtil.getJsonToList(CollectionitemList, CollectionitemModel.class));
|
|
|
|
|
|
|
|
|
|
//附表数据转换
|
|
|
|
|
|
|
|
|
|
//添加到详情表单对象中
|
|
|
|
|
Map<String,Object> contractCodeMap = new HashMap<>();
|
|
|
|
|
vo.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229","id","contract_name",vo.getContractCode(),contractCodeMap));
|
|
|
|
|
Map<String,Object> supplierIdMap = new HashMap<>();
|
|
|
|
|
vo.setSupplierName(generaterSwapUtil.getPopupSelectValue("397751667988199621","id","supplier_name",vo.getSupplierId(),supplierIdMap));
|
|
|
|
|
Map<String, Object> contractCodeMap = new HashMap<>();
|
|
|
|
|
vo.setContractName(generaterSwapUtil.getPopupSelectValue("390143765857220229", "id", "contract_name", vo.getContractCode(), contractCodeMap));
|
|
|
|
|
Map<String, Object> supplierIdMap = new HashMap<>();
|
|
|
|
|
vo.setSupplierName(generaterSwapUtil.getPopupSelectValue("397751667988199621", "id", "supplier_name", vo.getSupplierId(), supplierIdMap));
|
|
|
|
|
vo.setCreatorUserName(generaterSwapUtil.userSelectValue(vo.getCreatorUserName()));
|
|
|
|
|
|
|
|
|
|
return ActionResult.success(vo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 更新
|
|
|
|
|
*
|
|
|
|
@ -747,7 +741,7 @@ public class PurchaseorderController {
|
|
|
|
|
public ActionResult update(@PathVariable("id") String id, @RequestBody @Valid PurchaseorderUpForm purchaseorderUpForm) throws DataException {
|
|
|
|
|
UserInfo userInfo = userProvider.get();
|
|
|
|
|
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
|
|
|
|
|
if(!entity.getStatus().equals("0")){
|
|
|
|
|
if (!entity.getStatus().equals("0")) {
|
|
|
|
|
String info = "";
|
|
|
|
|
switch (entity.getStatus()) {
|
|
|
|
|
case "1":
|
|
|
|
@ -760,7 +754,7 @@ public class PurchaseorderController {
|
|
|
|
|
info = "归档";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return ActionResult.fail("已"+info+",无法编辑!");
|
|
|
|
|
return ActionResult.fail("已" + info + ",无法编辑!");
|
|
|
|
|
}
|
|
|
|
|
if (entity != null) {
|
|
|
|
|
PurchaseorderitemEntity subentity = JsonUtil.getJsonToBean(purchaseorderUpForm, PurchaseorderitemEntity.class);
|
|
|
|
@ -794,12 +788,12 @@ public class PurchaseorderController {
|
|
|
|
|
invoices_item0itemService.save(entitys);
|
|
|
|
|
}
|
|
|
|
|
QueryWrapper<PaymentdocpoEntity> PaymentdocpoWrapper = new QueryWrapper<>();
|
|
|
|
|
PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo,entity.getDocumentNo());
|
|
|
|
|
PaymentdocpoWrapper.lambda().eq(PaymentdocpoEntity::getPurchaseOrderNo, entity.getDocumentNo());
|
|
|
|
|
List<PaymentdocpoEntity> paymentdocList = paymentdocpoService.list(PaymentdocpoWrapper);
|
|
|
|
|
|
|
|
|
|
for (PaymentdocpoEntity paymentdocpoEntity : paymentdocList) {
|
|
|
|
|
QueryWrapper<PaymentitemEntity> queryWrapper = new QueryWrapper<>();
|
|
|
|
|
queryWrapper.lambda().eq(PaymentitemEntity::getPaymentno,paymentdocpoEntity.getDocumentNo());
|
|
|
|
|
queryWrapper.lambda().eq(PaymentitemEntity::getPaymentno, paymentdocpoEntity.getDocumentNo());
|
|
|
|
|
paymentitemService.remove(queryWrapper);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -847,7 +841,6 @@ public class PurchaseorderController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 删除
|
|
|
|
|
*
|
|
|
|
@ -856,27 +849,27 @@ public class PurchaseorderController {
|
|
|
|
|
*/
|
|
|
|
|
@DeleteMapping("/{id}")
|
|
|
|
|
@Transactional
|
|
|
|
|
public ActionResult delete(@PathVariable("id") String id){
|
|
|
|
|
PurchaseorderitemEntity entity= purchaseorderitemService.getInfo(id);
|
|
|
|
|
if (!entity.getStatus().equals("0")){
|
|
|
|
|
public ActionResult delete(@PathVariable("id") String id) {
|
|
|
|
|
PurchaseorderitemEntity entity = purchaseorderitemService.getInfo(id);
|
|
|
|
|
if (!entity.getStatus().equals("0")) {
|
|
|
|
|
return ActionResult.fail("该状态下不允许删除!");
|
|
|
|
|
}
|
|
|
|
|
if(entity!=null){
|
|
|
|
|
if (entity != null) {
|
|
|
|
|
purchaseorderitemService.delete(entity);
|
|
|
|
|
QueryWrapper<Purchaseorder_item0Entity> queryWrapperPurchaseorder_item0=new QueryWrapper<>();
|
|
|
|
|
queryWrapperPurchaseorder_item0.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId,entity.getId());
|
|
|
|
|
QueryWrapper<Purchaseorder_item0Entity> queryWrapperPurchaseorder_item0 = new QueryWrapper<>();
|
|
|
|
|
queryWrapperPurchaseorder_item0.lambda().eq(Purchaseorder_item0Entity::getPurchaseorderId, entity.getId());
|
|
|
|
|
purchaseorder_item0Service.remove(queryWrapperPurchaseorder_item0);
|
|
|
|
|
QueryWrapper<Invoices_item0itemEntity> queryWrapperInvoices_item0item=new QueryWrapper<>();
|
|
|
|
|
queryWrapperInvoices_item0item.lambda().eq(Invoices_item0itemEntity::getPurchaseorderId,entity.getId());
|
|
|
|
|
QueryWrapper<Invoices_item0itemEntity> queryWrapperInvoices_item0item = new QueryWrapper<>();
|
|
|
|
|
queryWrapperInvoices_item0item.lambda().eq(Invoices_item0itemEntity::getPurchaseorderId, entity.getId());
|
|
|
|
|
invoices_item0itemService.remove(queryWrapperInvoices_item0item);
|
|
|
|
|
QueryWrapper<PaymentitemEntity> queryWrapperPaymentitem=new QueryWrapper<>();
|
|
|
|
|
queryWrapperPaymentitem.lambda().eq(PaymentitemEntity::getDocumentno,entity.getDocumentNo());
|
|
|
|
|
QueryWrapper<PaymentitemEntity> queryWrapperPaymentitem = new QueryWrapper<>();
|
|
|
|
|
queryWrapperPaymentitem.lambda().eq(PaymentitemEntity::getDocumentno, entity.getDocumentNo());
|
|
|
|
|
paymentitemService.remove(queryWrapperPaymentitem);
|
|
|
|
|
QueryWrapper<PurchasebackitemEntity> queryWrapperPurchasebackitem=new QueryWrapper<>();
|
|
|
|
|
queryWrapperPurchasebackitem.lambda().eq(PurchasebackitemEntity::getPurchaseOrderId,entity.getId());
|
|
|
|
|
QueryWrapper<PurchasebackitemEntity> queryWrapperPurchasebackitem = new QueryWrapper<>();
|
|
|
|
|
queryWrapperPurchasebackitem.lambda().eq(PurchasebackitemEntity::getPurchaseOrderId, entity.getId());
|
|
|
|
|
purchasebackitemService.remove(queryWrapperPurchasebackitem);
|
|
|
|
|
QueryWrapper<CollectionpoEntity> queryWrapperCollectionitem=new QueryWrapper<>();
|
|
|
|
|
queryWrapperCollectionitem.lambda().eq(CollectionpoEntity::getSalesOrderNo,entity.getDocumentNo());
|
|
|
|
|
QueryWrapper<CollectionpoEntity> queryWrapperCollectionitem = new QueryWrapper<>();
|
|
|
|
|
queryWrapperCollectionitem.lambda().eq(CollectionpoEntity::getSalesOrderNo, entity.getDocumentNo());
|
|
|
|
|
collectionpoService.remove(queryWrapperCollectionitem);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -884,8 +877,4 @@ public class PurchaseorderController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|