caozj 2 жил өмнө
parent
commit
a6a70f4813
51 өөрчлөгдсөн 1552 нэмэгдсэн , 38 устгасан
  1. 20 2
      bladex/blade-common/src/main/java/org/springblade/common/utils/CodeUtil.java
  2. 6 1
      hx-saas-project/saas-entity/src/main/java/com/fjhx/contract/entity/PurchaseContract.java
  3. 0 5
      hx-saas-project/saas-entity/src/main/java/com/fjhx/contract/entity/PurchaseContractMaterial.java
  4. 64 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/contract/entity/PurchaseContractbatch.java
  5. 6 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/Supplier.java
  6. 2 2
      hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierPrice.java
  7. 120 0
      hx-saas-project/saas-entity/src/main/java/com/fjhx/tag/entity/Tag.java
  8. 9 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/controller/PurchaseContractController.java
  9. 7 4
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/controller/PurchaseContractFlowController.java
  10. 73 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/controller/PurchaseContractbatchController.java
  11. 8 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractMapper.java
  12. 42 10
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractMapper.xml
  13. 30 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractbatchMapper.java
  14. 19 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractbatchMapper.xml
  15. 7 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/IPurchaseContractService.java
  16. 36 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/IPurchaseContractbatchService.java
  17. 18 2
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/impl/PurchaseContractFlowServiceImpl.java
  18. 9 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/impl/PurchaseContractServiceImpl.java
  19. 68 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/impl/PurchaseContractbatchServiceImpl.java
  20. 3 3
      hx-saas-project/saas-storage/src/main/java/com/fjhx/subscribe/service/impl/ApplyPurchaseFlowServiceImpl.java
  21. 29 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierPriceController.java
  22. 20 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java
  23. 32 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml
  24. 16 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierService.java
  25. 20 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/ASupplierServiceImpl.java
  26. 97 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/controller/TagController.java
  27. 31 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/mapper/TagMapper.java
  28. 29 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/mapper/TagMapper.xml
  29. 30 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/service/ITagService.java
  30. 34 0
      hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/service/impl/TagServiceImpl.java
  31. 80 0
      hx-service-api/a-api/src/main/java/com/fjhx/entity/u/UMessage.java
  32. 17 0
      hx-service-api/a-api/src/main/java/com/fjhx/params/u/UMessageEx.java
  33. 17 0
      hx-service-api/a-api/src/main/java/com/fjhx/params/u/UMessageVo.java
  34. 67 0
      hx-service-api/storage-api/src/main/java/com/fjhx/entity/message/UMessage.java
  35. 56 0
      hx-service/a/src/main/java/com/fjhx/controller/u/UMessageController.java
  36. 16 0
      hx-service/a/src/main/java/com/fjhx/mapper/u/UMessageMapper.java
  37. 5 0
      hx-service/a/src/main/java/com/fjhx/mapper/u/UMessageMapper.xml
  38. 28 0
      hx-service/a/src/main/java/com/fjhx/service/u/UMessageService.java
  39. 54 0
      hx-service/a/src/main/java/com/fjhx/service/u/impl/UMessageServiceImpl.java
  40. 1 1
      hx-service/iot-management/src/main/java/com/fjhx/material/service/impl/MaterialExServiceImpl.java
  41. 11 4
      hx-service/storage/src/main/java/com/fjhx/material/controller/MaterialController.java
  42. 12 2
      hx-service/storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.xml
  43. 6 0
      hx-service/storage/src/main/java/com/fjhx/material/service/MaterialService.java
  44. 19 1
      hx-service/storage/src/main/java/com/fjhx/material/service/impl/MaterialServiceImpl.java
  45. 64 0
      hx-service/storage/src/main/java/com/fjhx/message/controller/UMessageController.java
  46. 45 0
      hx-service/storage/src/main/java/com/fjhx/message/mapper/UMessageMapper.java
  47. 55 0
      hx-service/storage/src/main/java/com/fjhx/message/mapper/UMessageMapper.xml
  48. 42 0
      hx-service/storage/src/main/java/com/fjhx/message/service/UMessageService.java
  49. 56 0
      hx-service/storage/src/main/java/com/fjhx/message/service/impl/UMessageServiceImpl.java
  50. 6 1
      hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml
  51. 10 0
      hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

+ 20 - 2
bladex/blade-common/src/main/java/org/springblade/common/utils/CodeUtil.java

@@ -34,7 +34,7 @@ public class CodeUtil {
     public static String generateSubscribeCode(String code){
     public static String generateSubscribeCode(String code){
         String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
         String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
         DecimalFormat decimalFormat=new DecimalFormat("0000");
         DecimalFormat decimalFormat=new DecimalFormat("0000");
-        String codenew=code.substring(1);
+        String codenew=code.substring(code.length()-4);
         int i=Integer.parseInt(codenew)+1;
         int i=Integer.parseInt(codenew)+1;
         String k=decimalFormat.format(i);
         String k=decimalFormat.format(i);
         return "PR-"+date+"-"+k;
         return "PR-"+date+"-"+k;
@@ -48,9 +48,27 @@ public class CodeUtil {
     public static String generateContractCode(String code){
     public static String generateContractCode(String code){
         String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
         String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
         DecimalFormat decimalFormat=new DecimalFormat("0000");
         DecimalFormat decimalFormat=new DecimalFormat("0000");
-        String codenew=code.substring(1);
+        String codenew=code.substring(code.length()-4);
         int i=Integer.parseInt(codenew)+1;
         int i=Integer.parseInt(codenew)+1;
         String k=decimalFormat.format(i);
         String k=decimalFormat.format(i);
         return "PO-"+date+"-"+k;
         return "PO-"+date+"-"+k;
     }
     }
+
+    /**
+     * 生成合同批次编码
+     * @param code
+     * @return
+     */
+    public static String generateContractBatchCode(String code){
+        String date = new SimpleDateFormat("yyyyMMdd").format(new Date());
+        DecimalFormat decimalFormat=new DecimalFormat("000");
+        String codenew=code.substring(code.length()-3);
+        int i=Integer.parseInt(codenew)+1;
+        String k=decimalFormat.format(i);
+        return code+"-"+k;
+    }
+
+    public static void main(String[] args) {
+        System.out.println(generateContractBatchCode("PR-20220728-0001-001"));
+    }
 }
 }

+ 6 - 1
hx-saas-project/saas-entity/src/main/java/com/fjhx/contract/entity/PurchaseContract.java

@@ -83,7 +83,7 @@ public class PurchaseContract extends BaseStockEntity {
 	* 签约时间
 	* 签约时间
 	*/
 	*/
 	@ApiModelProperty(value = "签约时间")
 	@ApiModelProperty(value = "签约时间")
-	private LocalDateTime signTime;
+	private Date signTime;
 	/**
 	/**
 	* 采购合同状态 (枚举定义:0=待确认,1=审批中,2=进行中,3=已完成)
 	* 采购合同状态 (枚举定义:0=待确认,1=审批中,2=进行中,3=已完成)
 	*/
 	*/
@@ -192,6 +192,11 @@ public class PurchaseContract extends BaseStockEntity {
 	 */
 	 */
 	@TableField(exist = false)
 	@TableField(exist = false)
 	private String materialCode;
 	private String materialCode;
+	/**
+	 * 物料ID
+	 */
+	@TableField(exist = false)
+	private String materialId;
 
 
 	/**
 	/**
 	 * 申购单号
 	 * 申购单号

+ 0 - 5
hx-saas-project/saas-entity/src/main/java/com/fjhx/contract/entity/PurchaseContractMaterial.java

@@ -61,11 +61,6 @@ public class PurchaseContractMaterial extends BaseStockEntity {
 	@ApiModelProperty(value = "单价")
 	@ApiModelProperty(value = "单价")
 	private BigDecimal price;
 	private BigDecimal price;
 	/**
 	/**
-	* 账号
-	*/
-	@ApiModelProperty(value = "账号")
-	private String bankAccout;
-	/**
 	* 金额
 	* 金额
 	*/
 	*/
 	@ApiModelProperty(value = "金额")
 	@ApiModelProperty(value = "金额")

+ 64 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/contract/entity/PurchaseContractbatch.java

@@ -0,0 +1,64 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.contract.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import java.time.LocalDateTime;
+import java.io.Serializable;
+
+import com.fjhx.base.BaseStockEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 采购批次号实体类
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+@Data
+@TableName("stock_purchase_contractbatch")
+@ApiModel(value = "PurchaseContractbatch对象", description = "采购批次号")
+public class PurchaseContractbatch extends BaseStockEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 批次号
+	*/
+	@ApiModelProperty(value = "批次号")
+	private String batchNo;
+	/**
+	* 采购合同单号
+	*/
+	@ApiModelProperty(value = "采购合同单号")
+	private String purchaseBillNo;
+	/**
+	* 出货时间
+	*/
+	@ApiModelProperty(value = "出货时间")
+	private LocalDateTime shipTime;
+	/**
+	* 合同批次出货状态 (枚举定义:0=未出货,1=已出货)
+	*/
+	@ApiModelProperty(value = "合同批次出货状态 (枚举定义:0=未出货,1=已出货)")
+	private Integer batchShipStatus;
+
+
+}

+ 6 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/Supplier.java

@@ -258,4 +258,10 @@ public class Supplier extends BaseStockEntity {
 	 */
 	 */
 	@TableField(exist = false)
 	@TableField(exist = false)
 	private BigDecimal money;
 	private BigDecimal money;
+
+	/**
+	 * 供应商价格
+	 */
+	@TableField(exist = false)
+	private BigDecimal price;
 }
 }

+ 2 - 2
hx-saas-project/saas-entity/src/main/java/com/fjhx/supplier/entity/SupplierPrice.java

@@ -47,9 +47,9 @@ public class SupplierPrice extends BaseStockEntity {
 	@ApiModelProperty(value = "供应商ID")
 	@ApiModelProperty(value = "供应商ID")
 	private String supplierId;
 	private String supplierId;
 	/**
 	/**
-	* 物料编号
+	* 物料ID
 	*/
 	*/
-	@ApiModelProperty(value = "物料编号")
+	@ApiModelProperty(value = "物料ID")
 	private String materialId;
 	private String materialId;
 	/**
 	/**
 	* 采购单价
 	* 采购单价

+ 120 - 0
hx-saas-project/saas-entity/src/main/java/com/fjhx/tag/entity/Tag.java

@@ -0,0 +1,120 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.tag.entity;
+
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+import com.fjhx.base.BaseStockEntity;
+import com.fjhx.base.BasicEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 物料库存明细实体类
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+@Data
+@TableName("stock_tag")
+@ApiModel(value = "Tag对象", description = "物料库存明细")
+public class Tag extends BaseStockEntity {
+
+	private static final long serialVersionUID = 1L;
+
+
+	/**
+	* 物料ID
+	*/
+	@ApiModelProperty(value = "物料ID")
+	private String materialId;
+	/**
+	* 物料数量
+	*/
+	@ApiModelProperty(value = "物料数量")
+	private BigDecimal quantity;
+	/**
+	* 二维码
+	*/
+	@ApiModelProperty(value = "二维码")
+	private String qrCode;
+	/**
+	* RFID码
+	*/
+	@ApiModelProperty(value = "RFID码")
+	private String rfidCode;
+	/**
+	* 入库编号
+	*/
+	@ApiModelProperty(value = "入库编号")
+	@TableField("stockIn_out_bill_no")
+	private String stockinOutBillNo;
+	/**
+	* 采购合同ID
+	*/
+	@ApiModelProperty(value = "采购合同ID")
+	private String purchaseContractId;
+	/**
+	* 已打印
+	*/
+	@ApiModelProperty(value = "已打印")
+	private Boolean hadPrinter;
+	/**
+	* 已出货
+	*/
+	@ApiModelProperty(value = "已出货")
+	private Boolean hadShipment;
+	/**
+	* 采购进度 (枚举定义:0=供应商打码,1=供应商出货,2=到货贴标,3=本厂入库,4=现场回仓)
+	*/
+	@ApiModelProperty(value = "采购进度 (枚举定义:0=供应商打码,1=供应商出货,2=到货贴标,3=本厂入库,4=现场回仓)")
+	private Integer purchaseProgress;
+	/**
+	* 出货物流Id
+	*/
+	@ApiModelProperty(value = "出货物流Id")
+	private String expressId;
+	/**
+	* 贴标人
+	*/
+	@ApiModelProperty(value = "贴标人")
+	private String labelUserId;
+	/**
+	* 序号
+	*/
+	@ApiModelProperty(value = "序号")
+	private Integer number;
+	/**
+	* 合同批次ID
+	*/
+	@ApiModelProperty(value = "合同批次ID")
+	private String batchId;
+	/**
+	* 质检状态 (枚举定义:0=未质检,1=已质检,2=无需质检)
+	*/
+	@ApiModelProperty(value = "质检状态 (枚举定义:0=未质检,1=已质检,2=无需质检)")
+	private Integer quantityCheckState;
+
+
+}

+ 9 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/controller/PurchaseContractController.java

@@ -24,6 +24,7 @@ import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 import javax.validation.Valid;
 import javax.validation.Valid;
 
 
+import oracle.jdbc.proxy.annotation.Post;
 import org.springblade.common.constant.ApiConstant;
 import org.springblade.common.constant.ApiConstant;
 import org.springblade.common.utils.ListPageMap;
 import org.springblade.common.utils.ListPageMap;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Condition;
@@ -82,6 +83,14 @@ public class PurchaseContractController extends BladeController {
 		return R.data(detail);
 		return R.data(detail);
 	}
 	}
 
 
+	/**
+	 * 详情
+	 */
+	@PostMapping("/statistics/class")
+	public R statisticsClass(@RequestBody Map<String, Object> condition) {
+		List<Map<String,Object>> list = purchaseContractService.statisticsClassify(condition);
+		return R.success(list);
+	}
 
 
 	
 	
 }
 }

+ 7 - 4
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/controller/PurchaseContractFlowController.java

@@ -16,6 +16,9 @@
  */
  */
 package com.fjhx.contract.controller;
 package com.fjhx.contract.controller;
 
 
+import com.fjhx.contract.entity.PurchaseContract;
+import com.fjhx.contract.service.IPurchaseContractFlowService;
+import com.fjhx.contract.service.IPurchaseContractService;
 import com.fjhx.flow.entity.FlowParam;
 import com.fjhx.flow.entity.FlowParam;
 import com.fjhx.subscribe.entity.ApplyPurchase;
 import com.fjhx.subscribe.entity.ApplyPurchase;
 import com.fjhx.subscribe.service.IApplyPurchaseFlowService;
 import com.fjhx.subscribe.service.IApplyPurchaseFlowService;
@@ -40,18 +43,18 @@ import org.springframework.web.bind.annotation.RestController;
 @RequestMapping(ApiConstant.Project.SAAS_STORAGE_REQUEST_PREFIX+"/purchasecontract/flow")
 @RequestMapping(ApiConstant.Project.SAAS_STORAGE_REQUEST_PREFIX+"/purchasecontract/flow")
 public class PurchaseContractFlowController extends BladeController {
 public class PurchaseContractFlowController extends BladeController {
 
 
-	private final IApplyPurchaseFlowService flowService;
+	private final IPurchaseContractFlowService flowService;
 
 
 
 
 	/**
 	/**
 	 * 开始流程
 	 * 开始流程
 	 *
 	 *
-	 * @param applyPurchase
+	 * @param purchaseContract
 	 * @return
 	 * @return
 	 */
 	 */
 	@PostMapping(value = "/start")
 	@PostMapping(value = "/start")
-	public R start(@RequestBody ApplyPurchase applyPurchase) {
-		flowService.start(applyPurchase);
+	public R start(@RequestBody PurchaseContract purchaseContract) {
+		flowService.start(purchaseContract);
 		return R.success();
 		return R.success();
 	}
 	}
 
 

+ 73 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/controller/PurchaseContractbatchController.java

@@ -0,0 +1,73 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.contract.controller;
+
+import com.fjhx.contract.entity.PurchaseContractbatch;
+import com.fjhx.contract.service.IPurchaseContractbatchService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiParam;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.common.constant.ApiConstant;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 采购批次号 控制器
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping(ApiConstant.Project.SAAS_STORAGE_REQUEST_PREFIX+"/purchasecontractbatch")
+@Api(value = "采购批次号", tags = "采购批次号接口")
+public class PurchaseContractbatchController extends BladeController {
+
+	private final IPurchaseContractbatchService purchaseContractbatchService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	public R<PurchaseContractbatch> detail(PurchaseContractbatch purchaseContractbatch) {
+		PurchaseContractbatch detail = purchaseContractbatchService.getOne(Condition.getQueryWrapper(purchaseContractbatch));
+		return R.data(detail);
+	}
+
+	/**
+	 * 新增 采购批次号
+	 */
+	@PostMapping("/save")
+	public R save(@Valid @RequestBody PurchaseContractbatch purchaseContractbatch) {
+		return R.status(purchaseContractbatchService.saveContractBatch(purchaseContractbatch));
+	}
+	
+	/**
+	 * 删除 采购批次号
+	 */
+	@PostMapping("/remove")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(purchaseContractbatchService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 8 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractMapper.java

@@ -56,4 +56,12 @@ public interface PurchaseContractMapper extends BaseMapper<PurchaseContract> {
      */
      */
     @TenantIgnore
     @TenantIgnore
     PurchaseContract getDetailById(@Param("id") String id);
     PurchaseContract getDetailById(@Param("id") String id);
+
+    /**
+     * 统计表头分类
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Map<String,Object>> getClassByTechnology(Map<String, Object> condition);
 }
 }

+ 42 - 10
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractMapper.xml

@@ -36,6 +36,7 @@
             t1.*,
             t1.*,
             t2.purchase_qty AS purchaseQty,
             t2.purchase_qty AS purchaseQty,
             t2.price AS purchasePrice,
             t2.price AS purchasePrice,
+            t3.`id` AS materialId,
             t3.`name` AS materialName,
             t3.`name` AS materialName,
             t3.spec AS materialSpec,
             t3.spec AS materialSpec,
             t3.`code` AS materialCode,
             t3.`code` AS materialCode,
@@ -71,6 +72,7 @@
             t2.purchase_qty AS purchaseQty,
             t2.purchase_qty AS purchaseQty,
             t2.price AS purchasePrice,
             t2.price AS purchasePrice,
             t2.total_amount AS purchaseTotalAmount,
             t2.total_amount AS purchaseTotalAmount,
+            t3.`id` AS materialId,
             t3.unit AS materialUnit,
             t3.unit AS materialUnit,
             t3.`name` AS materialName,
             t3.`name` AS materialName,
             t3.spec AS materialSpec,
             t3.spec AS materialSpec,
@@ -86,16 +88,46 @@
         t1.id = #{id}
         t1.id = #{id}
         AND t1.is_delete = 0
         AND t1.is_delete = 0
     </select>
     </select>
+    <select id="getClassByTechnology" resultType="java.util.Map">
+        SELECT
+            t3.technology_type AS technologyType,
+            SUM( t2.total_amount )AS sumMoney
+        FROM
+            stock_purchase_contract t1
+        LEFT JOIN stock_purchase_contract_material t2 ON t1.id = t2.purchase_contract_id
+        LEFT JOIN stock_material t3 ON t2.material_id = t3.id
+        <include refid="class_condition"/>
+        GROUP BY
+            t3.technology_type
+    </select>
     <sql id="list_condition">
     <sql id="list_condition">
-        t1.is_delete = 0
-        <if test="search neq null and search neq '' ">
-            AND ((INSTR(t1.purchase_bill_no, #{search}) > 0) OR (INSTR(t3.`name`, #{search}) > 0) )
-        </if>
-        <if test="purContractState neq null and purContractState neq '' ">
-            AND t1.pur_contract_state = #{purContractState}
-        </if>
-        <if test="technologyType neq null and technologyType neq ''">
-            AND t3.technology_type = #{technologyType}
-        </if>
+        <where>
+            t1.is_delete = 0
+            <if test="search neq null and search neq '' ">
+                AND ((INSTR(t1.purchase_bill_no, #{search}) > 0) OR (INSTR(t3.`name`, #{search}) > 0) )
+            </if>
+            <if test="purContractState neq null and purContractState eq 1">
+                AND t1.pur_contract_state in (0,1)
+            </if>
+            <if test="purContractState neq null and purContractState neq 1">
+                AND t1.pur_contract_state = #{purContractState}
+            </if>
+            <if test="technologyType neq null and technologyType neq ''">
+                AND t3.technology_type = #{technologyType}
+            </if>
+        </where>
+
+    </sql>
+    <sql id="class_condition">
+        <where>
+            t1.is_delete = 0
+            <if test="search neq null and search neq '' ">
+                AND ((INSTR(t1.purchase_bill_no, #{search}) > 0) OR (INSTR(t3.`name`, #{search}) > 0) )
+            </if>
+            <if test="technologyType neq null and technologyType neq ''">
+                AND t3.technology_type = #{technologyType}
+            </if>
+        </where>
+
     </sql>
     </sql>
 </mapper>
 </mapper>

+ 30 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractbatchMapper.java

@@ -0,0 +1,30 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.contract.mapper;
+
+import com.fjhx.contract.entity.PurchaseContractbatch;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 采购批次号 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+public interface PurchaseContractbatchMapper extends BaseMapper<PurchaseContractbatch> {
+
+}

+ 19 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/mapper/PurchaseContractbatchMapper.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.contract.mapper.PurchaseContractbatchMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="purchaseContractbatchResultMap" type="com.fjhx.contract.entity.PurchaseContractbatch">
+        <id column="id" property="id"/>
+        <result column="batch_no" property="batchNo"/>
+        <result column="purchase_bill_no" property="purchaseBillNo"/>
+        <result column="ship_time" property="shipTime"/>
+        <result column="batch_ship_status" property="batchShipStatus"/>
+        <result column="is_delete" property="isDelete"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="create_user" property="createUser"/>
+        <result column="update_user" property="updateUser"/>
+    </resultMap>
+
+</mapper>

+ 7 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/IPurchaseContractService.java

@@ -59,4 +59,11 @@ public interface IPurchaseContractService extends IService<PurchaseContract> {
      * @return
      * @return
      */
      */
     PurchaseContract getDetail(String id);
     PurchaseContract getDetail(String id);
+
+
+    /**
+     * 表头分类
+     * @return
+     */
+    List<Map<String,Object>> statisticsClassify(Map<String, Object> condition);
 }
 }

+ 36 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/IPurchaseContractbatchService.java

@@ -0,0 +1,36 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.contract.service;
+
+import com.fjhx.contract.entity.PurchaseContractbatch;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 采购批次号 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+public interface IPurchaseContractbatchService extends IService<PurchaseContractbatch> {
+
+    /**
+     * 添加
+     * @param purchaseContractbatch
+     * @return
+     */
+    Boolean saveContractBatch(PurchaseContractbatch purchaseContractbatch);
+}

+ 18 - 2
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/impl/PurchaseContractFlowServiceImpl.java

@@ -16,8 +16,10 @@
  */
  */
 package com.fjhx.contract.service.impl;
 package com.fjhx.contract.service.impl;
 
 
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.fjhx.contract.entity.PurchaseContract;
 import com.fjhx.contract.entity.PurchaseContract;
+import com.fjhx.contract.entity.PurchaseContractMaterial;
 import com.fjhx.contract.enums.PurchaseContractStatusEnum;
 import com.fjhx.contract.enums.PurchaseContractStatusEnum;
 import com.fjhx.contract.mapper.PurchaseContractMapper;
 import com.fjhx.contract.mapper.PurchaseContractMapper;
 import com.fjhx.contract.service.IPurchaseContractFlowService;
 import com.fjhx.contract.service.IPurchaseContractFlowService;
@@ -38,6 +40,8 @@ import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
 import org.springblade.system.user.feign.IUserClient;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.util.Date;
 import java.util.Date;
 
 
@@ -71,19 +75,31 @@ public class PurchaseContractFlowServiceImpl extends ServiceImpl<PurchaseContrac
             throw new ServiceException("请选择供应商");
             throw new ServiceException("请选择供应商");
         }
         }
         User user = userClient.infoUser(AuthUtil.getUserIdStr());
         User user = userClient.infoUser(AuthUtil.getUserIdStr());
+        //查询供应商
         Supplier supplier = iSupplierService.getById(purchaseContract.getSupplierId());
         Supplier supplier = iSupplierService.getById(purchaseContract.getSupplierId());
+        //查询合同
+        PurchaseContract contract = getById(purchaseContract.getId());
+        if(ObjectUtil.isEmpty(contract)){
+            throw new ServiceException("合同不存在");
+        }
         //计算交货日期  当前时间+供应商账期
         //计算交货日期  当前时间+供应商账期
         if(ObjectUtil.isEmpty(supplier.getAccountDate())){
         if(ObjectUtil.isEmpty(supplier.getAccountDate())){
             purchaseContract.setDeliverTime(new Date());
             purchaseContract.setDeliverTime(new Date());
         }else{
         }else{
             purchaseContract.setDeliverTime(DateUtil.dateAddASub(new Date(),supplier.getAccountDate()));
             purchaseContract.setDeliverTime(DateUtil.dateAddASub(new Date(),supplier.getAccountDate()));
         }
         }
+        purchaseContract.setTaxValue(new BigDecimal("0.13"));
         purchaseContract.setApproveBillState(ApplyPurchaseStatusEnum.APPLY_PURCHASE_STATUS_1.getKey());
         purchaseContract.setApproveBillState(ApplyPurchaseStatusEnum.APPLY_PURCHASE_STATUS_1.getKey());
         purchaseContract.setPurContractState(PurchaseContractStatusEnum.APPLY_PURCHASE_STATUS_1.getKey());
         purchaseContract.setPurContractState(PurchaseContractStatusEnum.APPLY_PURCHASE_STATUS_1.getKey());
         updateById(purchaseContract);
         updateById(purchaseContract);
-        String title = "caozj" + " 在" + LocalDate.now() + "日发起了 合同审批流程(单号" + purchaseContract.getPurchaseBillNo() + ")";
+        //修改物料得总价
+        PurchaseContractMaterial material = new PurchaseContractMaterial();
+        material.setTotalAmount(purchaseContract.getPurchaseTotalAmount());
+        material.setPrice(purchaseContract.getPurchasePrice());
+        iPurchaseContractMaterialService.update(material,Wrappers.<PurchaseContractMaterial>query().lambda().eq(PurchaseContractMaterial::getPurchaseContractId,purchaseContract.getId()));
+        String title = "caozj" + " 在" + LocalDate.now() + "日发起了 合同审批流程(单号" + contract.getPurchaseBillNo() + ")";
         //发起流程
         //发起流程
-        FlowParam param = new FlowParam(title,null,purchaseContract.getId(), FlowTypeEnum.type_2.getValue(),null);
+        FlowParam param = new FlowParam(title,null,null, FlowTypeEnum.type_2.getValue(),purchaseContract.getId());
         try {
         try {
             flowApi.startFlow(param);
             flowApi.startFlow(param);
         }catch (Exception e){
         }catch (Exception e){

+ 9 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/impl/PurchaseContractServiceImpl.java

@@ -79,6 +79,15 @@ public class PurchaseContractServiceImpl extends ServiceImpl<PurchaseContractMap
         return baseMapper.getDetailById(id);
         return baseMapper.getDetailById(id);
     }
     }
 
 
+    /**
+     * 统计分类
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> statisticsClassify(Map<String, Object> condition) {
+        return baseMapper.getClassByTechnology(condition);
+    }
 
 
     /**
     /**
      * 保存合同
      * 保存合同

+ 68 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/contract/service/impl/PurchaseContractbatchServiceImpl.java

@@ -0,0 +1,68 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.contract.service.impl;
+
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.fjhx.contract.entity.PurchaseContract;
+import com.fjhx.contract.entity.PurchaseContractbatch;
+import com.fjhx.contract.mapper.PurchaseContractbatchMapper;
+import com.fjhx.contract.service.IPurchaseContractbatchService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.utils.CodeUtil;
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.core.tool.utils.StringUtil;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * 采购批次号 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+@Service
+public class PurchaseContractbatchServiceImpl extends ServiceImpl<PurchaseContractbatchMapper, PurchaseContractbatch> implements IPurchaseContractbatchService {
+
+    /**
+     * 添加批次
+     * @param purchaseContractbatch
+     * @return
+     */
+    @Override
+    public Boolean saveContractBatch(PurchaseContractbatch purchaseContractbatch) {
+        if(StringUtil.isEmpty(purchaseContractbatch.getPurchaseBillNo())){
+            throw new ServiceException("合同单号不能为空");
+        }
+        //生成code
+        PurchaseContractbatch sCode = getOne(Wrappers.<PurchaseContractbatch>query().lambda().
+                eq(PurchaseContractbatch::getPurchaseBillNo,purchaseContractbatch.getPurchaseBillNo()).
+                orderByDesc(PurchaseContractbatch::getBatchNo).last("limit 1"));
+        String code = purchaseContractbatch.getPurchaseBillNo()+"-001";
+        if(ObjectUtil.isEmpty(sCode)){
+            purchaseContractbatch.setBatchNo(code);
+        }else{
+            purchaseContractbatch.setBatchNo(sCode.getBatchNo()==null?code: CodeUtil.generateContractCode(sCode.getBatchNo()));
+        }
+        purchaseContractbatch.setCreate();
+        save(purchaseContractbatch);
+        return true;
+    }
+}

+ 3 - 3
hx-saas-project/saas-storage/src/main/java/com/fjhx/subscribe/service/impl/ApplyPurchaseFlowServiceImpl.java

@@ -132,16 +132,16 @@ public class ApplyPurchaseFlowServiceImpl extends ServiceImpl<ApplyPurchaseMappe
                 this.updateById(update);
                 this.updateById(update);
                 //生成合同
                 //生成合同
                 PurchaseContract contract = new PurchaseContract();
                 PurchaseContract contract = new PurchaseContract();
-                contract.setApplyPurchaseId(condition.getBusinessId());
                 List<PurchaseContractMaterial> materialList = new ArrayList<>();
                 List<PurchaseContractMaterial> materialList = new ArrayList<>();
                 PurchaseContractMaterial material = new PurchaseContractMaterial();
                 PurchaseContractMaterial material = new PurchaseContractMaterial();
                 for(ApplyPurchasedetail d:purchasedetailList){
                 for(ApplyPurchasedetail d:purchasedetailList){
                     material.setMaterialId(d.getMaterialId());
                     material.setMaterialId(d.getMaterialId());
                     material.setPurchaseQty(d.getPurchaseQty());
                     material.setPurchaseQty(d.getPurchaseQty());
                     materialList.add(material);
                     materialList.add(material);
+                    contract.setApplyPurchaseId(condition.getBusinessId());
+                    contract.setMaterialList(materialList);
+                    iPurchaseContractService.savePurchaseContract(contract);
                 }
                 }
-                contract.setMaterialList(materialList);
-                iPurchaseContractService.savePurchaseContract(contract);
             }
             }
         }catch (Exception e){
         }catch (Exception e){
             throw new ServiceException("流程异常");
             throw new ServiceException("流程异常");

+ 29 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/controller/SupplierPriceController.java

@@ -19,15 +19,19 @@ package com.fjhx.supplier.controller;
 import com.fjhx.supplier.entity.Supplier;
 import com.fjhx.supplier.entity.Supplier;
 import com.fjhx.supplier.entity.SupplierPrice;
 import com.fjhx.supplier.entity.SupplierPrice;
 import com.fjhx.supplier.service.ISupplierPriceService;
 import com.fjhx.supplier.service.ISupplierPriceService;
+import com.fjhx.supplier.service.ISupplierService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import lombok.AllArgsConstructor;
 import lombok.AllArgsConstructor;
 
 
 import org.springblade.common.constant.ApiConstant;
 import org.springblade.common.constant.ApiConstant;
+import org.springblade.common.utils.ListPageMap;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.api.R;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.boot.ctrl.BladeController;
 
 
 import javax.validation.Valid;
 import javax.validation.Valid;
+import java.util.List;
+import java.util.Map;
 
 
 /**
 /**
  * 供应商价格 控制器
  * 供应商价格 控制器
@@ -43,6 +47,7 @@ public class SupplierPriceController extends BladeController {
 
 
 	private final ISupplierPriceService supplierPriceService;
 	private final ISupplierPriceService supplierPriceService;
 
 
+	private final ISupplierService iSupplierService;
 
 
 	/**
 	/**
 	 * 新增 供应商价格
 	 * 新增 供应商价格
@@ -52,5 +57,29 @@ public class SupplierPriceController extends BladeController {
 		supplierPrice.setCreate();
 		supplierPrice.setCreate();
 		return R.status(supplierPriceService.save(supplierPrice));
 		return R.status(supplierPriceService.save(supplierPrice));
 	}
 	}
+
+	/**
+	 * 列表
+	 * @param condition
+	 * @return
+	 */
+	@PostMapping("/list")
+	public R list(@RequestBody Map<String, Object> condition){
+		ListPageMap.getListPageMap(condition);
+		List<Supplier> result = iSupplierService.getSuPriceList(condition);
+		return R.success(result);
+	}
+
+	/**
+	 * 列表条数
+	 * @param condition
+	 * @return
+	 */
+	@PostMapping("/list/count")
+	public R listCount(@RequestBody Map<String, Object> condition){
+		ListPageMap.getListPageMap(condition);
+		Integer count = iSupplierService.getSuPriceListCount(condition);
+		return R.success(count);
+	}
 	
 	
 }
 }

+ 20 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.java

@@ -56,4 +56,24 @@ public interface SupplierMapper extends BaseMapper<Supplier> {
      */
      */
     @TenantIgnore
     @TenantIgnore
     List<Supplier> getGroupByCategory();
     List<Supplier> getGroupByCategory();
+
+
+
+    /**
+     * 列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<Supplier> getSuPriceList(Map<String, Object> condition);
+
+    /**
+     * 列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    Integer getSuPriceListCount(Map<String, Object> condition);
 }
 }

+ 32 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -28,6 +28,9 @@
         <result column="certificate" property="certificate"/>
         <result column="certificate" property="certificate"/>
         <result column="representative" property="representative"/>
         <result column="representative" property="representative"/>
         <result column="business_license" property="businessLicense"/>
         <result column="business_license" property="businessLicense"/>
+
+        <result column="price" property="price"/>
+
     </resultMap>
     </resultMap>
 
 
     <select id="getList" resultType="com.fjhx.supplier.entity.Supplier">
     <select id="getList" resultType="com.fjhx.supplier.entity.Supplier">
@@ -84,6 +87,35 @@
         GROUP BY
         GROUP BY
             t3.technology_type
             t3.technology_type
     </select>
     </select>
+
+    <select id="getSuPriceList" resultMap="supplierResultMap">
+        SELECT
+            t1.price,
+            t2.*
+        FROM
+            stock_supplier_price t1
+        LEFT JOIN stock_supplier t2 ON t1.supplier_id = t2.id
+        <include refid="price_list_condition"/>
+        ORDER BY t1.create_time DESC
+        <include refid="com.fjhx.house.mapper.HouseMapper.sql_limit"/>
+    </select>
+    <select id="getSuPriceListCount" resultType="java.lang.Integer">
+        SELECT
+            t1.price,
+            t2.*
+        FROM
+            stock_supplier_price t1
+        LEFT JOIN stock_supplier t2 ON t1.supplier_id = t2.id
+        <include refid="price_list_condition"/>
+    </select>
+    <sql id="price_list_condition">
+        <where>
+            t2.is_delete = 0
+            <if test="name neq null and name neq '' ">
+                AND INSTR( t2.`name`, #{name} ) > 0
+            </if>
+        </where>
+    </sql>
     <sql id="warningCount_filed">
     <sql id="warningCount_filed">
         SELECT count( 1 ) FROM stock_supplier_problem WHERE supplier_id = t1.id
         SELECT count( 1 ) FROM stock_supplier_problem WHERE supplier_id = t1.id
     </sql>
     </sql>

+ 16 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/ISupplierService.java

@@ -69,4 +69,20 @@ public interface ISupplierService extends IService<Supplier> {
      * @return
      * @return
      */
      */
     List<Supplier> statisticsClassify();
     List<Supplier> statisticsClassify();
+
+    /**
+     * 供应商价格列表
+     *
+     * @param condition
+     * @return
+     */
+    List<Supplier> getSuPriceList(Map<String, Object> condition);
+
+    /**
+     * 供应商价格列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    Integer getSuPriceListCount(Map<String, Object> condition);
 }
 }

+ 20 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/supplier/service/impl/ASupplierServiceImpl.java

@@ -212,4 +212,24 @@ public class ASupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier>
         return baseMapper.getGroupByCategory();
         return baseMapper.getGroupByCategory();
     }
     }
 
 
+    /**
+     * 供应商价格列表
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<Supplier> getSuPriceList(Map<String, Object> condition) {
+        return baseMapper.getSuPriceList(condition);
+    }
+
+    /**
+     * 供应商价格列表条数
+     * @param condition
+     * @return
+     */
+    @Override
+    public Integer getSuPriceListCount(Map<String, Object> condition) {
+        return baseMapper.getSuPriceListCount(condition);
+    }
+
 }
 }

+ 97 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/controller/TagController.java

@@ -0,0 +1,97 @@
+///*
+// *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+// *
+// *  Redistribution and use in source and binary forms, with or without
+// *  modification, are permitted provided that the following conditions are met:
+// *
+// *  Redistributions of source code must retain the above copyright notice,
+// *  this list of conditions and the following disclaimer.
+// *  Redistributions in binary form must reproduce the above copyright
+// *  notice, this list of conditions and the following disclaimer in the
+// *  documentation and/or other materials provided with the distribution.
+// *  Neither the name of the dreamlu.net developer nor the names of its
+// *  contributors may be used to endorse or promote products derived from
+// *  this software without specific prior written permission.
+// *  Author: Chill 庄骞 (smallchill@163.com)
+// */
+//package com.fjhx.tag.controller;
+//
+//import com.fjhx.tag.service.ITagService;
+//import io.swagger.annotations.Api;
+//import io.swagger.annotations.ApiOperation;
+//import io.swagger.annotations.ApiParam;
+//import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+//import lombok.AllArgsConstructor;
+//import javax.validation.Valid;
+//
+//import org.springblade.common.constant.ApiConstant;
+//import org.springblade.core.mp.support.Condition;
+//import org.springblade.core.mp.support.Query;
+//import org.springblade.core.tool.api.R;
+//import org.springblade.core.tool.utils.Func;
+//import org.springframework.web.bind.annotation.*;
+//import com.baomidou.mybatisplus.core.metadata.IPage;
+//import contract.entity.Tag;
+//import contract.vo.TagVO;
+//import contract.service.ITagService;
+//import org.springblade.core.boot.ctrl.BladeController;
+//
+///**
+// * 物料库存明细 控制器
+// *
+// * @author BladeX
+// * @since 2022-07-29
+// */
+//@RestController
+//@AllArgsConstructor
+//@RequestMapping(ApiConstant.Project.SAAS_STORAGE_REQUEST_PREFIX+"/tag")
+//@Api(value = "物料库存明细", tags = "物料库存明细接口")
+//public class TagController extends BladeController {
+//
+//	private final ITagService tagService;
+//
+//
+//
+//	/**
+//	 * 新增 物料库存明细
+//	 */
+//	@PostMapping("/save")
+//	@ApiOperationSupport(order = 4)
+//	@ApiOperation(value = "新增", notes = "传入tag")
+//	public R save(@Valid @RequestBody Tag tag) {
+//		return R.status(tagService.save(tag));
+//	}
+//
+//	/**
+//	 * 修改 物料库存明细
+//	 */
+//	@PostMapping("/update")
+//	@ApiOperationSupport(order = 5)
+//	@ApiOperation(value = "修改", notes = "传入tag")
+//	public R update(@Valid @RequestBody Tag tag) {
+//		return R.status(tagService.updateById(tag));
+//	}
+//
+//	/**
+//	 * 新增或修改 物料库存明细
+//	 */
+//	@PostMapping("/submit")
+//	@ApiOperationSupport(order = 6)
+//	@ApiOperation(value = "新增或修改", notes = "传入tag")
+//	public R submit(@Valid @RequestBody Tag tag) {
+//		return R.status(tagService.saveOrUpdate(tag));
+//	}
+//
+//
+//	/**
+//	 * 删除 物料库存明细
+//	 */
+//	@PostMapping("/remove")
+//	@ApiOperationSupport(order = 8)
+//	@ApiOperation(value = "删除", notes = "传入ids")
+//	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+//		return R.status(tagService.removeByIds(Func.toLongList(ids)));
+//	}
+//
+//
+//}

+ 31 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/mapper/TagMapper.java

@@ -0,0 +1,31 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.tag.mapper;
+
+import com.fjhx.tag.entity.Tag;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 物料库存明细 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+public interface TagMapper extends BaseMapper<Tag> {
+
+
+}

+ 29 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/mapper/TagMapper.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.tag.mapper.TagMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="tagResultMap" type="com.fjhx.tag.entity.Tag">
+        <id column="ID" property="id"/>
+        <result column="is_delete" property="isDelete"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="create_user" property="createUser"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="material_id" property="materialId"/>
+        <result column="quantity" property="quantity"/>
+        <result column="qr_code" property="qrCode"/>
+        <result column="rfid_code" property="rfidCode"/>
+        <result column="stockIn_out_bill_no" property="stockinOutBillNo"/>
+        <result column="purchase_contract_id" property="purchaseContractId"/>
+        <result column="had_printer" property="hadPrinter"/>
+        <result column="had_shipment" property="hadShipment"/>
+        <result column="purchase_progress" property="purchaseProgress"/>
+        <result column="express_id" property="expressId"/>
+        <result column="label_user_id" property="labelUserId"/>
+        <result column="number" property="number"/>
+        <result column="batch_id" property="batchId"/>
+        <result column="quantity_check_state" property="quantityCheckState"/>
+    </resultMap>
+
+</mapper>

+ 30 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/service/ITagService.java

@@ -0,0 +1,30 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.tag.service;
+
+import com.fjhx.tag.entity.Tag;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * 物料库存明细 服务类
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+public interface ITagService extends IService<Tag> {
+
+}

+ 34 - 0
hx-saas-project/saas-storage/src/main/java/com/fjhx/tag/service/impl/TagServiceImpl.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package com.fjhx.tag.service.impl;
+
+import com.fjhx.tag.entity.Tag;
+import com.fjhx.tag.mapper.TagMapper;
+import com.fjhx.tag.service.ITagService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * 物料库存明细 服务实现类
+ *
+ * @author BladeX
+ * @since 2022-07-29
+ */
+@Service
+public class TagServiceImpl extends ServiceImpl<TagMapper, Tag> implements ITagService {
+
+}

+ 80 - 0
hx-service-api/a-api/src/main/java/com/fjhx/entity/u/UMessage.java

@@ -0,0 +1,80 @@
+package com.fjhx.entity.message;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.Version;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fjhx.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消息提醒
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UMessage extends BaseEntity {
+
+
+    /**
+     * 软删除
+     */
+    @TableField("IsDelete")
+    private Boolean isdelete;
+
+    /**
+     * 创建时间
+     */
+    @TableField("CreatedTime")
+    private Date createdtime;
+
+    /**
+     * 修改时间
+     */
+    @TableField("UpdatedTime")
+    private Date updatedtime;
+
+    /**
+     * 提醒来源 (枚举定义:0=物料申购,1=入库管理,2=库存管理,3=出库管理,4=系统提醒,5=盘点提醒)
+     */
+    @TableField("SourceType")
+    private Integer sourcetype;
+
+    /**
+     * 提醒内容
+     */
+    @TableField("Content")
+    private String content;
+
+    /**
+     * 发送消息用户ID
+     */
+    @TableField("SenderId")
+    private String senderid;
+
+    /**
+     * 消息提醒对象 (枚举定义:0=用户,1=角色,2=全员)
+     */
+    @TableField("ObejctType")
+    private Integer obejcttype;
+
+    /**
+     * 关联编号
+     */
+    @TableField("LinkId")
+    private String linkid;
+
+    /**
+     * 待办类型 (枚举定义:0=物料申购,1=合同管理,2=付款管理,3=出库管理,4=其他出库(退货、报损),5=质检数量修正申请,6=物料修改申请,7=物料价格调整,8=库存盘点,9=归还入库,10=合同删除,11=免检申请,12=供应商出货申请)
+     */
+    @TableField("DealWithType")
+    private Integer dealwithtype;
+
+
+}

+ 17 - 0
hx-service-api/a-api/src/main/java/com/fjhx/params/u/UMessageEx.java

@@ -0,0 +1,17 @@
+package com.fjhx.params.u;
+
+import com.fjhx.entity.message.UMessage;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 消息提醒
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UMessageEx extends UMessage {
+
+}

+ 17 - 0
hx-service-api/a-api/src/main/java/com/fjhx/params/u/UMessageVo.java

@@ -0,0 +1,17 @@
+package com.fjhx.params.u;
+
+import com.fjhx.entity.message.UMessage;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 消息提醒
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UMessageVo extends UMessage {
+
+}

+ 67 - 0
hx-service-api/storage-api/src/main/java/com/fjhx/entity/message/UMessage.java

@@ -0,0 +1,67 @@
+package com.fjhx.entity.message;
+
+import java.util.Date;
+
+import com.fjhx.base.BaseEntity;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.fjhx.base.BasicEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * <p>
+ * 消息提醒
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class UMessage extends BasicEntity {
+
+
+    /**
+     * 软删除
+     */
+    @TableField("IsDelete")
+    private Boolean isdelete;
+
+    /**
+     * 提醒来源 (枚举定义:0=物料申购,1=入库管理,2=库存管理,3=出库管理,4=系统提醒,5=盘点提醒)
+     */
+    @TableField("SourceType")
+    private Integer sourcetype;
+
+    /**
+     * 提醒内容
+     */
+    @TableField("Content")
+    private String content;
+
+    /**
+     * 发送消息用户ID
+     */
+    @TableField("SenderId")
+    private String senderid;
+
+    /**
+     * 消息提醒对象 (枚举定义:0=用户,1=角色,2=全员)
+     */
+    @TableField("ObejctType")
+    private Integer obejcttype;
+
+    /**
+     * 关联编号
+     */
+    @TableField("LinkId")
+    private String linkid;
+
+    /**
+     * 待办类型 (枚举定义:0=物料申购,1=合同管理,2=付款管理,3=出库管理,4=其他出库(退货、报损),5=质检数量修正申请,6=物料修改申请,7=物料价格调整,8=库存盘点,9=归还入库,10=合同删除,11=免检申请,12=供应商出货申请)
+     */
+    @TableField("DealWithType")
+    private Integer dealwithtype;
+
+
+}

+ 56 - 0
hx-service/a/src/main/java/com/fjhx/controller/u/UMessageController.java

@@ -0,0 +1,56 @@
+package com.fjhx.controller.u;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.springblade.core.tool.api.R;
+import com.fjhx.entity.message.UMessage;
+import com.fjhx.params.u.UMessageVo;
+import com.fjhx.service.u.UMessageService;
+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.Map;
+
+/**
+ * <p>
+ * 消息提醒 前端控制器
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@RestController
+@RequestMapping("/uMessage")
+public class UMessageController {
+
+    @Autowired
+    private UMessageService uMessageService;
+
+    @PostMapping("/page")
+    public R page(@RequestBody Map<String, String> condition){
+        Page<UMessage> result = uMessageService.getPage(condition);
+        return R.success(result);
+    }
+
+    @PostMapping("/add")
+    public R add(@RequestBody UMessageVo uMessageVo){
+        uMessageService.add(uMessageVo);
+        return R.success();
+    }
+
+    @PostMapping("/edit")
+    public R edit(@RequestBody UMessageVo uMessageVo){
+        uMessageService.edit(uMessageVo);
+        return R.success();
+    }
+
+    @PostMapping("/delete")
+    public R delete(@RequestBody UMessageVo uMessageVo){
+        uMessageService.delete(uMessageVo);
+        return R.success();
+    }
+
+}
+

+ 16 - 0
hx-service/a/src/main/java/com/fjhx/mapper/u/UMessageMapper.java

@@ -0,0 +1,16 @@
+package com.fjhx.mapper.u;
+
+import com.fjhx.entity.message.UMessage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 消息提醒 Mapper 接口
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+public interface UMessageMapper extends BaseMapper<UMessage> {
+
+}

+ 5 - 0
hx-service/a/src/main/java/com/fjhx/mapper/u/UMessageMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.mapper.u.UMessageMapper">
+
+</mapper>

+ 28 - 0
hx-service/a/src/main/java/com/fjhx/service/u/UMessageService.java

@@ -0,0 +1,28 @@
+package com.fjhx.service.u;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.entity.message.UMessage;
+import com.fjhx.params.u.UMessageVo;
+import com.fjhx.base.BaseService;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息提醒 服务类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+public interface UMessageService extends BaseService<UMessage> {
+
+    Page<UMessage> getPage(Map<String, String> condition);
+
+    void add(UMessageVo uMessageVo);
+
+    void edit(UMessageVo uMessageVo);
+
+    void delete(UMessageVo uMessageVo);
+
+}

+ 54 - 0
hx-service/a/src/main/java/com/fjhx/service/u/impl/UMessageServiceImpl.java

@@ -0,0 +1,54 @@
+package com.fjhx.service.u.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.utils.WrapperUtil;
+import com.fjhx.entity.message.UMessage;
+import com.fjhx.params.u.UMessageVo;
+import com.fjhx.mapper.u.UMessageMapper;
+import com.fjhx.service.u.UMessageService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息提醒 服务实现类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@Service
+public class UMessageServiceImpl extends ServiceImpl<UMessageMapper, UMessage> implements UMessageService {
+
+    @Override
+    public Page<UMessage> getPage(Map<String, String> condition) {
+
+        QueryWrapper<UMessage> wrapper = Wrappers.query();
+
+        WrapperUtil.init(condition, wrapper)
+                .createTimeDesc();
+
+        Page<UMessage> page = page(condition, wrapper);
+        return page;
+    }
+
+    @Override
+    public void add(UMessageVo uMessageVo) {
+        save(uMessageVo);
+    }
+
+    @Override
+    public void edit(UMessageVo uMessageVo) {
+        updateById(uMessageVo);
+    }
+
+    @Override
+    public void delete(UMessageVo uMessageVo) {
+        removeById(uMessageVo.getId());
+    }
+
+}

+ 1 - 1
hx-service/iot-management/src/main/java/com/fjhx/service/material/impl/MaterialExServiceImpl.java → hx-service/iot-management/src/main/java/com/fjhx/material/service/impl/MaterialExServiceImpl.java

@@ -1,4 +1,4 @@
-package com.fjhx.service.material.impl;
+package com.fjhx.material.service.impl;
 
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.ObjectUtil;

+ 11 - 4
hx-service/storage/src/main/java/com/fjhx/material/controller/MaterialController.java

@@ -5,10 +5,7 @@ import org.springblade.core.tool.api.R;
 import com.fjhx.entity.material.Material;
 import com.fjhx.entity.material.Material;
 import com.fjhx.material.service.MaterialService;
 import com.fjhx.material.service.MaterialService;
 import org.springframework.beans.factory.annotation.Autowired;
 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 org.springframework.web.bind.annotation.*;
 
 
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
@@ -39,5 +36,15 @@ public class MaterialController {
         List<Material> list = materialService.selectList(condition);
         List<Material> list = materialService.selectList(condition);
         return R.success(list);
         return R.success(list);
     }
     }
+
+    /**
+     * 下拉物料
+     * @return
+     */
+    @GetMapping("/selectPurposeList")
+    public R selectPurposeList(@RequestParam(required = false) String purpose){
+        List<Material> list = materialService.selectPurpose(purpose);
+        return R.success(list);
+    }
 }
 }
 
 

+ 12 - 2
hx-service/storage/src/main/java/com/fjhx/material/mapper/MaterialMapper.xml

@@ -4,11 +4,21 @@
 
 
     <select id="selectMaList" resultType="com.fjhx.entity.material.Material">
     <select id="selectMaList" resultType="com.fjhx.entity.material.Material">
         SELECT
         SELECT
-            *
+            t1.*
         FROM
         FROM
             material t1
             material t1
+        LEFT JOIN (
+            SELECT
+                materialcode,
+                sum( swd.ChangeNum ) AS sum
+            FROM
+                stock_waterdetial swd
+            WHERE
+                swd.StockChangeType IN ( 20, 23 )
+            GROUP BY MaterialCode
+        ) AS t2 ON t1.`Code` = t2.materialcode
         <include refid="list_condition"/>
         <include refid="list_condition"/>
-        ORDER BY t1.CreatedTime DESC
+        ORDER BY t2.sum DESC
         <include refid="com.fjhx.supplier.mapper.SupplierMapper.sql_limit"/>
         <include refid="com.fjhx.supplier.mapper.SupplierMapper.sql_limit"/>
     </select>
     </select>
     <sql id="list_condition">
     <sql id="list_condition">

+ 6 - 0
hx-service/storage/src/main/java/com/fjhx/material/service/MaterialService.java

@@ -24,4 +24,10 @@ public interface MaterialService extends BaseService<Material> {
      * @return
      * @return
      */
      */
     List<Material> selectList(Map<String, Object> condition);
     List<Material> selectList(Map<String, Object> condition);
+
+    /**
+     * 下拉用途
+     * @return
+     */
+    List<Material> selectPurpose(String purpose);
 }
 }

+ 19 - 1
hx-service/storage/src/main/java/com/fjhx/service/material/impl/MaterialServiceImpl.java → hx-service/storage/src/main/java/com/fjhx/material/service/impl/MaterialServiceImpl.java

@@ -1,10 +1,14 @@
-package com.fjhx.service.material.impl;
+package com.fjhx.material.service.impl;
 
 
 
 
+import com.alibaba.cloud.commons.lang.StringUtils;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.fjhx.entity.material.Material;
 import com.fjhx.entity.material.Material;
 import com.fjhx.material.mapper.MaterialSMapper;
 import com.fjhx.material.mapper.MaterialSMapper;
 import com.fjhx.material.service.MaterialService;
 import com.fjhx.material.service.MaterialService;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.core.tool.utils.StringUtil;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 
 
 import java.util.List;
 import java.util.List;
@@ -32,4 +36,18 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialSMapper, Material>
         List<Material> list = baseMapper.selectMaList(condition);
         List<Material> list = baseMapper.selectMaList(condition);
         return list;
         return list;
     }
     }
+
+    /**
+     * 下拉用途
+     * @return
+     */
+    @Override
+    public List<Material> selectPurpose(String purpose) {
+        QueryWrapper<Material> queryWrapper = new QueryWrapper<>();
+        queryWrapper.select("Purpose").groupBy("Purpose");
+        if(StringUtils.isNotEmpty(purpose)){
+            queryWrapper.like("Purpose",purpose);
+        }
+        return this.list(queryWrapper);
+    }
 }
 }

+ 64 - 0
hx-service/storage/src/main/java/com/fjhx/message/controller/UMessageController.java

@@ -0,0 +1,64 @@
+package com.fjhx.message.controller;
+
+import com.fjhx.base.ListPageMap;
+import com.fjhx.entity.message.UMessage;
+import com.fjhx.entity.supplier.Supplier;
+import com.fjhx.message.service.UMessageService;
+import org.springblade.core.tool.api.R;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息提醒 前端控制器
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@RestController
+@RequestMapping("/uMessage")
+public class UMessageController {
+
+    @Autowired
+    private UMessageService uMessageService;
+
+    /**
+     * 统计物料分类
+     * @return
+     */
+    @PostMapping("/statisticsClassify")
+    public R statisticsClassify(@RequestBody Map<String,Object> condition){
+        List<Map<String,Object>> list = uMessageService.getClassMessage(condition);
+        return R.success(list);
+    }
+
+    /**
+     * 列表
+     * @param condition
+     * @return
+     */
+    @PostMapping("/list")
+    public R list(@RequestBody Map<String, Object> condition){
+        ListPageMap.getListPageMap(condition);
+        List<UMessage> result = uMessageService.getList(condition);
+        return R.success(result);
+    }
+
+    /**
+     * 列表条数
+     * @param condition
+     * @return
+     */
+    @PostMapping("/list/count")
+    public R listCount(@RequestBody Map<String, Object> condition){
+        ListPageMap.getListPageMap(condition);
+        Integer count = uMessageService.getListCount(condition);
+        return R.success(count);
+    }
+
+}
+

+ 45 - 0
hx-service/storage/src/main/java/com/fjhx/message/mapper/UMessageMapper.java

@@ -0,0 +1,45 @@
+package com.fjhx.message.mapper;
+
+import com.fjhx.entity.message.UMessage;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fjhx.entity.supplier.Supplier;
+import org.springblade.core.tenant.annotation.TenantIgnore;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息提醒 Mapper 接口
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+public interface UMessageMapper extends BaseMapper<UMessage> {
+
+    /**
+     * 获取消息分类
+     * @param condition
+     * @return
+     */
+    List<Map<String,Object>> getClassMessage(Map<String,Object> condition);
+
+    /**
+     * 列表
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    List<UMessage> getList(Map<String, Object> condition);
+
+    /**
+     * 列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    @TenantIgnore
+    Integer getListCount(Map<String, Object> condition);
+}

+ 55 - 0
hx-service/storage/src/main/java/com/fjhx/message/mapper/UMessageMapper.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fjhx.message.mapper.UMessageMapper">
+
+    <select id="getClassMessage" resultType="java.util.Map">
+        SELECT
+            t2.SourceType AS sourceType,
+            Count( 1 ) AS count
+        FROM
+            u_messageread t1
+            LEFT JOIN u_message t2 ON t1.LinkMessageId = t2.ID
+            LEFT JOIN u_user t3 ON t1.ReceiverId = t3.ID
+        <where>
+            t3.JobNo = #{userNo}
+            AND t1.ReadState = #{readState}
+            <if test="search neq null and search neq '' ">
+                AND INSTR( t2.Content, #{search} ) > 0
+            </if>
+        </where>
+        GROUP BY
+            t2.SourceType
+    </select>
+    <select id="getList" resultType="com.fjhx.entity.message.UMessage">
+        SELECT
+            t2.*
+        FROM
+            u_messageread t1
+        LEFT JOIN u_message t2 ON t1.LinkMessageId = t2.ID
+        LEFT JOIN u_user t3 ON t1.ReceiverId = t3.ID
+        <include refid="list_condition"/>
+        ORDER BY t2.CreatedTime DESC
+        <include refid="com.fjhx.supplier.mapper.SupplierMapper.sql_limit"/>
+    </select>
+    <select id="getListCount" resultType="java.lang.Integer">
+        SELECT
+            count(1)
+        FROM
+            u_messageread t1
+        LEFT JOIN u_message t2 ON t1.LinkMessageId = t2.ID
+        LEFT JOIN u_user t3 ON t1.ReceiverId = t3.ID
+        <include refid="list_condition"/>
+    </select>
+    <sql id="list_condition">
+        <where>
+            t3.JobNo = #{userNo}
+            AND t1.ReadState = #{readState}
+            <if test="sourceType neq null ">
+                AND SourceType = #{sourceType}
+            </if>
+            <if test="search neq null and search neq '' ">
+                AND INSTR( t2.Content, #{search} ) > 0
+            </if>
+        </where>
+    </sql>
+</mapper>

+ 42 - 0
hx-service/storage/src/main/java/com/fjhx/message/service/UMessageService.java

@@ -0,0 +1,42 @@
+package com.fjhx.message.service;
+
+import com.fjhx.entity.message.UMessage;
+import com.fjhx.base.BaseService;
+import com.fjhx.entity.supplier.Supplier;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息提醒 服务类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+public interface UMessageService extends BaseService<UMessage> {
+
+    /**
+     * 获取消息分类
+     * @param condition
+     * @return
+     */
+    List<Map<String,Object>> getClassMessage(Map<String,Object> condition);
+
+    /**
+     * 列表
+     *
+     * @param condition
+     * @return
+     */
+    List<UMessage> getList(Map<String, Object> condition);
+
+    /**
+     * 列表-总条数
+     *
+     * @param condition
+     * @return
+     */
+    Integer getListCount(Map<String, Object> condition);
+}

+ 56 - 0
hx-service/storage/src/main/java/com/fjhx/message/service/impl/UMessageServiceImpl.java

@@ -0,0 +1,56 @@
+package com.fjhx.message.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.fjhx.message.mapper.UMessageMapper;
+import com.fjhx.message.service.UMessageService;
+import com.fjhx.utils.WrapperUtil;
+import com.fjhx.entity.message.UMessage;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <p>
+ * 消息提醒 服务实现类
+ * </p>
+ *
+ * @author ${author}
+ * @since 2022-07-29
+ */
+@Service
+public class UMessageServiceImpl extends ServiceImpl<UMessageMapper, UMessage> implements UMessageService {
+
+    /**
+     * 获取分类
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<Map<String, Object>> getClassMessage(Map<String, Object> condition) {
+        return baseMapper.getClassMessage(condition);
+    }
+
+    /**
+     * 列表
+     * @param condition
+     * @return
+     */
+    @Override
+    public List<UMessage> getList(Map<String, Object> condition) {
+        return baseMapper.getList(condition);
+    }
+
+    /**
+     * 列表条数
+     * @param condition
+     * @return
+     */
+    @Override
+    public Integer getListCount(Map<String, Object> condition) {
+        return baseMapper.getListCount(condition);
+    }
+}

+ 6 - 1
hx-service/storage/src/main/java/com/fjhx/supplier/mapper/SupplierMapper.xml

@@ -8,7 +8,12 @@
             t3.TechnologyType AS TechnologyType,
             t3.TechnologyType AS TechnologyType,
             (<include refid="warningCount_filed"/> ) AS warningCount,
             (<include refid="warningCount_filed"/> ) AS warningCount,
             (<include refid="warningTypeCount_filed"/> ) AS warningTypeCount,
             (<include refid="warningTypeCount_filed"/> ) AS warningTypeCount,
-            (select `Name` from material_category where `Code` = t1.CategoryCode) AS categoryName
+            (select `Name` from material_category where `Code` = t1.CategoryCode) AS categoryName,
+            FORMAT(IFNULL((<include refid="sumMoney_filed"/>),0),2)AS sumMoney,
+            FORMAT(IFNULL((<include refid="lastYearMoney_filed"/>),0),2)AS lastYearMoney,
+            FORMAT(IFNULL((<include refid="yearMoney_filed"/>),0),2)AS yearMoney,
+            FORMAT(IFNULL((<include refid="lastMonthMoney_filed"/>),0),2)AS lastMonthMoney,
+            FORMAT(IFNULL((<include refid="monthMoney_filed"/>),0),2)AS monthMoney
         FROM
         FROM
             supplier t1
             supplier t1
         LEFT JOIN supplier_price sp ON t1.ID = sp.FactoryId
         LEFT JOIN supplier_price sp ON t1.ID = sp.FactoryId

+ 10 - 0
hx-service/storage/src/main/java/com/fjhx/supplier/service/impl/SupplierServiceImpl.java

@@ -80,6 +80,11 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
      */
      */
     @Override
     @Override
     public List<Supplier> getPurList(Map<String, Object> condition) {
     public List<Supplier> getPurList(Map<String, Object> condition) {
+        if(ObjectUtil.isNotEmpty(condition.get("TechnologyType"))&&
+                StringUtil.equals(condition.get("TechnologyType").toString(),"99")){
+            condition.put("TechnologyType",null);
+            return baseMapper.getSumList(condition);
+        }
         return baseMapper.getPurList(condition);
         return baseMapper.getPurList(condition);
     }
     }
 
 
@@ -90,6 +95,11 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
      */
      */
     @Override
     @Override
     public Integer getPurListCount(Map<String, Object> condition) {
     public Integer getPurListCount(Map<String, Object> condition) {
+        if(ObjectUtil.isNotEmpty(condition.get("TechnologyType"))&&
+                StringUtil.equals(condition.get("TechnologyType").toString(),"99")){
+            condition.put("TechnologyType",null);
+            return baseMapper.getSumListCount(condition);
+        }
         return baseMapper.getPurListCount(condition);
         return baseMapper.getPurListCount(condition);
     }
     }