Kaynağa Gözat

通报时间设置

yuansh 1 hafta önce
ebeveyn
işleme
85eb29afe3

+ 10 - 0
jeecg-boot-base-core/src/main/java/org/jeecg/common/util/DateUtils.java

@@ -170,6 +170,16 @@ public class DateUtils extends PropertyEditorSupport {
         Date date = str2Date(str, date_sdf.get());
         return new Timestamp(date.getTime());
     }
+    /**
+     * 字符串转换时间戳
+     *
+     * @param str
+     * @return
+     */
+    public static Date strToDate(String str) {
+        Date date = str2Date(str, date_sdf.get());
+        return date;
+    }
 
     /**
      * 字符串转换成日期

+ 9 - 9
srm-module-code/src/main/java/org/jeecg/modules/cuspCode/vo/CuspCustomerProfilePage.java

@@ -43,10 +43,6 @@ public class CuspCustomerProfilePage {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
 	@ApiModelProperty(value = "更新时间")
     private Date updateTime;
-	/**状态(1-启用,0-停用)*/
-//	@Excel(name = "状态(status)", width = 15)
-	@ApiModelProperty(value = "状态(1-启用,0-停用)")
-    private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
 //	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
 	@ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
@@ -56,23 +52,23 @@ public class CuspCustomerProfilePage {
 	@ApiModelProperty(value = "编码")
     private String code;
 	/**名称*/
-	@Excel(name = "名称(name)", width = 15)
+	@Excel(name = "名称(name)", width = 35)
 	@ApiModelProperty(value = "名称")
     private String name;
 	/**简称*/
-	@Excel(name = "简称(abbreviation)", width = 15)
+	@Excel(name = "简称(abbreviation)", width = 25)
 	@ApiModelProperty(value = "简称")
     private String abbreviation;
 	/**曾用名*/
-	@Excel(name = "曾用名(nameUsedBefore)", width = 15)
+	@Excel(name = "曾用名(nameUsedBefore)", width = 25)
 	@ApiModelProperty(value = "曾用名")
     private String nameUsedBefore;
 	/**税号*/
-	@Excel(name = "税号(duty paragraph)", width = 15)
+	@Excel(name = "税号(duty paragraph)", width = 25)
 	@ApiModelProperty(value = "税号")
     private String dutyParagraph;
 	/**法人*/
-	@Excel(name = "法人(legal person)", width = 15)
+	@Excel(name = "法人(legal person)", width = 25)
 	@ApiModelProperty(value = "法人")
     private String legalPerson;
 	/**联系人*/
@@ -139,6 +135,10 @@ public class CuspCustomerProfilePage {
 	@Excel(name = "备注(notes)", width = 15)
 	@ApiModelProperty(value = "备注")
     private String notes;
+	/**状态(1-启用,0-停用)*/
+	@Excel(name = "是否启用(status)", width = 15,dicCode = "yes_or_no")
+	@ApiModelProperty(value = "状态(1-启用,0-停用)")
+	private Integer status;
 	/**文件*/
 //	@Excel(name = "文件", width = 15)
 	@ApiModelProperty(value = "文件")

+ 46 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/controller/PurDeliveryNoteController.java

@@ -100,8 +100,53 @@ public class PurDeliveryNoteController {
 		return Result.OK(pageList);
 	}
 
+
+	/**
+	 * 分页列表到货单弹框主表(采购入库新增使用)
+	 *
+	 * @param purDeliveryNote
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@ApiOperation(value="到货单(delivery note)-分页列表到货单弹框主表", notes="到货单(delivery note)-分页列表到货单弹框主表")
+	@GetMapping(value = "/listHead")
+	public Result<IPage<PurDeliveryNote>> listHead(PurDeliveryNote purDeliveryNote,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+        QueryWrapper<PurDeliveryNote> queryWrapper = QueryGenerator.initQueryWrapper(purDeliveryNote, req.getParameterMap());
+		Page<PurDeliveryNote> page = new Page<PurDeliveryNote>(pageNo, pageSize);
+		IPage<PurDeliveryNote> pageList = purDeliveryNoteService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+//
+//	/**
+//	 * 分页列表到货单弹框主表(采购入库新增使用)
+//	 *
+//	 * @param
+//	 * @param pageNo
+//	 * @param pageSize
+//	 * @param req
+//	 * @return
+//	 */
+//	@ApiOperation(value="到货单弹框明细", notes="到货单弹框明细")
+//	@GetMapping(value = "/listHead111")
+//	public Result<IPage<PurDeliveryNote>> listHead111(PurDeliveryNoteAlert saleInquiryForm,
+//								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+//								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+//								   HttpServletRequest req) {
+//
+//
+//        QueryWrapper<PurDeliveryNote> queryWrapper = QueryGenerator.initQueryWrapper(purDeliveryNote, req.getParameterMap());
+//		Page<PurDeliveryNote> page = new Page<PurDeliveryNote>(pageNo, pageSize);
+//		IPage<PurDeliveryNote> pageList = purDeliveryNoteService.page(page, queryWrapper);
+//		return Result.OK(pageList);
+//	}
+
 	 /**
-	  * 到货单弹框明细
+	  * 到货单弹框明细(采购入库新增使用)
 	  * @param saleInquiryForm
 	  * @param pageNo
 	  * @param pageSize

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/purCode/mapper/xml/PurDeliveryNoteArrivalMapper.xml

@@ -16,7 +16,7 @@
 
     <select id="purDeliveryNoteArrivalAlert" parameterType="java.lang.String" resultType="org.jeecg.modules.purCode.vo.PurDeliveryNoteAlert">
         select *
-        from (select a.id    headId
+        from (select a.id    head_id
                    , b.id    child_id
                    , a.model head_model
                    , b.model child_model

+ 99 - 8
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleOrderController.java

@@ -33,13 +33,11 @@ import org.jeecg.modules.cuspCode.entity.CuspCustomerProfile;
 import org.jeecg.modules.cuspCode.entity.CuspCustomerProfileMan;
 import org.jeecg.modules.cuspCode.service.ICuspCustomerProfileManService;
 import org.jeecg.modules.cuspCode.service.ICuspCustomerProfileService;
-import org.jeecg.modules.purCode.entity.PurCommissionRequest;
-import org.jeecg.modules.purCode.entity.PurOrder;
-import org.jeecg.modules.purCode.entity.PurOrderProduct;
-import org.jeecg.modules.purCode.entity.PurQuotationSelectionProduct;
+import org.jeecg.modules.purCode.entity.*;
 import org.jeecg.modules.purCode.service.IPurCommissionRequestService;
 import org.jeecg.modules.purCode.service.IPurOrderService;
 import org.jeecg.modules.purCode.service.IPurQuotationSelectionProductService;
+import org.jeecg.modules.purCode.service.IPurQuotationSelectionService;
 import org.jeecg.modules.saleCode.entity.*;
 import org.jeecg.modules.saleCode.service.*;
 import org.jeecg.modules.saleCode.vo.SaleOrderAlert;
@@ -133,6 +131,8 @@ public class SaleOrderController {
     private ISaleQuotationProductService saleQuotationProductService;
     @Autowired
     private IPurQuotationSelectionProductService purQuotationSelectionProductService;
+    @Autowired
+    private IPurQuotationSelectionService purQuotationSelectionService;
 
     @Value(value = "${jeecg.path.upload}")
     private String uploadpath;
@@ -157,9 +157,40 @@ public class SaleOrderController {
         QueryWrapper<SaleOrder> queryWrapper = QueryGenerator.initQueryWrapper(saleOrder, req.getParameterMap());
         Page<SaleOrder> page = new Page<SaleOrder>(pageNo, pageSize);
         IPage<SaleOrder> pageList = saleOrderService.page(page, queryWrapper);
+        List<SaleOrder> saleOrderList = pageList.getRecords();
+
+        if (saleOrderList.size()>0){
+            QueryWrapper<SaleQuotation> querySaleQuotation = new QueryWrapper<>();
+            querySaleQuotation.lambda().in(SaleQuotation::getBillCode, saleOrderList.stream().map(SaleOrder::getSourceCode).collect(Collectors.toList()));
+            List<SaleQuotation> listQuotation = saleQuotationService.list(querySaleQuotation);
+            if (listQuotation.size()>0){
+
+                QueryWrapper<PurQuotationSelection> querySelection = new QueryWrapper<>();
+                querySelection.lambda().in(PurQuotationSelection::getBillCode, listQuotation.stream().map(SaleQuotation::getSourceCode).collect(Collectors.toList()));
+                List<PurQuotationSelection> listSelection = purQuotationSelectionService.list(querySelection);
+
+                for (SaleOrder q : saleOrderList){
+
+                    List<SaleQuotation> findSaleQuotationList = listQuotation.stream().filter(p->p.getBillCode().equals(q.getSourceCode())).collect(Collectors.toList());
+
+                    List<PurQuotationSelection> findPurQuotationSelectionList = listSelection.stream().filter(i->{
+                        return findSaleQuotationList.stream().filter(p->i.getBillCode().equals(p.getSourceCode())).count()>0;
+                    }).collect(Collectors.toList());
+
+                    q.setQualityGrade(String.join(",",findPurQuotationSelectionList.stream().map(PurQuotationSelection::getQualityGradeHead).distinct().collect(Collectors.toList())));
+
+
+                }
+
+            }
+        }
+
+
+
         return Result.OK(pageList);
     }
 
+
     /**
      * 销售订单弹框明细-佣金付款使用
      *
@@ -495,7 +526,52 @@ public class SaleOrderController {
         return Result.OK("批量删除成功!");
     }
 
+    /**
+     * 批量修改通报时间
+     *
+     * @param ids
+     * @return
+     */
+    @AutoLog(value = "设置通报时间")
+    @ApiOperation(value = "设置通报时间", notes = "设置通报时间")
+    @GetMapping(value = "/notifiedBatch")
+    public Result<String> notifiedBatch(@RequestParam(name = "ids", required = true) String ids,
+                                        @RequestParam(name = "notified", required = true) String notified) {
+
+
+        if(StringUtils.isBlank(ids) || StringUtils.isBlank(notified)){
 
+            return Result.error("请填写日期!");
+        }
+
+        QueryWrapper<SaleOrder> queryWrapper = new QueryWrapper<>();
+        queryWrapper.in("id", Arrays.asList(ids.split(",")));
+
+        List<SaleOrder> list = saleOrderService.list(queryWrapper);
+        if (list.size() == 0) {
+            return Result.error("数据为空!");
+        }
+
+//        for (SaleOrder o : list) {
+//
+//            Date notDate = o.getNotified();
+//            String code = o.getBillCode();
+//
+//            if(notDate!=null){
+//                return Result.error("单号" + code +" 已设置通报时间,请单独执行!");
+//            }
+//
+//        }
+
+        Date notDate = DateUtils.strToDate(notified);
+
+        SaleOrder ent = new SaleOrder();
+        ent.setNotified(notDate);
+        saleOrderService.update(ent, queryWrapper);
+
+        return Result.OK("设置通报时间成功!");
+
+    }
     /**
      * 批量提交
      *
@@ -1245,10 +1321,25 @@ public class SaleOrderController {
 
     public static void main(String[] args) {
 
-        BigDecimal getSalePrice = new BigDecimal("90");
-        BigDecimal dis = new BigDecimal("10");
+        Double aa = 92.000;
+        Double vv = 98.00;
+
+        double epsilon = 1e-9; // 定义一个很小的数作为误差容忍度
+        System.out.println(Math.abs(aa - vv));
+        if (Math.abs(aa - vv) > epsilon) {
+
+            System.out.println(1111);
+        }
+        Map<String,String> map = new HashMap<String, String>();
+        map.put("454545454","55555555");
+        map.put("4545415454","55555555");
+        System.out.println(map);
+
 
-        System.out.println((new BigDecimal("100").subtract(dis)).divide(new BigDecimal("100")));
-        System.out.println(getSalePrice.divide(new BigDecimal("0.9")).setScale(2, RoundingMode.HALF_UP));
+//        BigDecimal getSalePrice = new BigDecimal("90");
+//        BigDecimal dis = new BigDecimal("10");
+//
+//        System.out.println((new BigDecimal("100").subtract(dis)).divide(new BigDecimal("100")));
+//        System.out.println(getSalePrice.divide(new BigDecimal("0.9")).setScale(2, RoundingMode.HALF_UP));
     }
 }

+ 43 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java

@@ -843,6 +843,49 @@ public class SaleQuotationController {
         }
         //Step.2 获取导出数据
         List<SaleQuotation> saleQuotationList = saleQuotationService.list(queryWrapper);
+//
+//        // Step.3 组装pageList
+//        List<SaleQuotationPage> pageList = new ArrayList<SaleQuotationPage>();
+//        for (SaleQuotation main : saleQuotationList) {
+//            SaleQuotationPage vo = new SaleQuotationPage();
+//            BeanUtils.copyProperties(main, vo);
+//            List<SaleQuotationShip> saleQuotationShipList = saleQuotationShipService.selectByMainId(main.getId());
+//            vo.setSaleQuotationShipList(saleQuotationShipList);
+//            List<SaleQuotationProduct> saleQuotationProductList = saleQuotationProductService.selectByMainId(main.getId());
+//            vo.setSaleQuotationProductList(saleQuotationProductList);
+//            pageList.add(vo);
+//        }
+
+        // Step.4 AutoPoi 导出Excel
+        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+        mv.addObject(NormalExcelConstants.FILE_NAME, "销售报价单列表");
+        mv.addObject(NormalExcelConstants.CLASS, SaleQuotation.class);
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("销售报价单数据", "导出人:" + sysUser.getRealname(), "销售报价单"));
+        mv.addObject(NormalExcelConstants.DATA_LIST, saleQuotationList);
+        return mv;
+    }
+
+    /**
+     * 导出excel
+     *
+     * @param request
+     * @param saleQuotation
+     */
+    @RequiresPermissions("saleCode:sale_quotation:exportXls")
+    @RequestMapping(value = "/exportXls22222")
+    public ModelAndView exportXls22222(HttpServletRequest request, SaleQuotation saleQuotation) {
+        // Step.1 组装查询条件查询数据
+        QueryWrapper<SaleQuotation> queryWrapper = QueryGenerator.initQueryWrapper(saleQuotation, request.getParameterMap());
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+
+        //配置选中数据查询条件
+        String selections = request.getParameter("selections");
+        if (oConvertUtils.isNotEmpty(selections)) {
+            List<String> selectionList = Arrays.asList(selections.split(","));
+            queryWrapper.in("id", selectionList);
+        }
+        //Step.2 获取导出数据
+        List<SaleQuotation> saleQuotationList = saleQuotationService.list(queryWrapper);
 
         // Step.3 组装pageList
         List<SaleQuotationPage> pageList = new ArrayList<SaleQuotationPage>();

+ 7 - 2
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleOrder.java

@@ -44,6 +44,11 @@ public class SaleOrder implements Serializable {
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "确认时间")
     private Date confirmTime;
+
+    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+    @DateTimeFormat(pattern="yyyy-MM-dd")
+    @ApiModelProperty(value = "notified")
+    private Date notified;
 	/**创建人*/
     @ApiModelProperty(value = "创建人")
     private String createBy;
@@ -244,8 +249,8 @@ public class SaleOrder implements Serializable {
 	@Excel(name = "版本号", width = 15)
     @ApiModelProperty(value = "版本号")
     private String version;
-    private String sourceCode;
-    private String sourceCode2;
+    private String sourceCode;//销售报价单
+    private String sourceCode2;//销售合同
 
     //协议条款
     private String agreementTerms;

+ 11 - 15
srm-module-code/src/main/java/org/jeecg/modules/saleCode/entity/SaleQuotation.java

@@ -61,11 +61,10 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "更新时间")
     private Date updateTime;
 	/**状态(1-已提交,0-未提交)*/
-	@Excel(name = "状态(1-已提交,0-未提交)", width = 15)
+    @Excel(name = "状态", width = 15,dicCode = "yes_or_no")
     @ApiModelProperty(value = "状态(1-已提交,0-未提交)")
     private Integer status;
 	/**删除状态(0-正常,1-已删除)*/
-	@Excel(name = "删除状态(0-正常,1-已删除)", width = 15)
     @ApiModelProperty(value = "删除状态(0-正常,1-已删除)")
     @TableLogic
     private Integer delFlag;
@@ -80,7 +79,6 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "单据编码")
     private String billCode;
 	/**报价项目*/
-	@Excel(name = "报价项目", width = 15)
     @ApiModelProperty(value = "报价项目")
     private String quotationProject;
 	/**报价项目名称*/
@@ -88,7 +86,6 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "报价项目名称")
     private String quotationProjectName;
 	/**报价客户*/
-	@Excel(name = "报价客户", width = 15)
     @ApiModelProperty(value = "报价客户")
     @Dict(dictTable = "cusp_customer_profile", dicCode = "id", dicText = "abbreviation")
     private String quotationCustomer;
@@ -118,7 +115,7 @@ public class SaleQuotation implements Serializable {
     @Dict(dicCode = "priority")
     private String priority;
 	/**产品分类(production class)*/
-	@Excel(name = "产品分类(production class)", width = 15)
+	@Excel(name = "产品分类(production class)", width = 15, dictTable = "base_product_class", dicCode = "id", dicText = "name")
     @ApiModelProperty(value = "产品分类(production class)")
     @Dict(dictTable = "base_product_class", dicCode = "id", dicText = "name")
     private String productionClass;
@@ -139,7 +136,7 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "贸易方式(delivery terms)")
     private String deliveryTerms;
 	/**交期(delivery time)*/
-//	@Excel(name = "交期(delivery time)", width = 20, format = "yyyy-MM-dd")
+	@Excel(name = "交期(delivery time)", width = 20, format = "yyyy-MM-dd")
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
     @DateTimeFormat(pattern="yyyy-MM-dd")
     @ApiModelProperty(value = "交期(delivery time)")
@@ -161,25 +158,23 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "包装方式(packaging method)")
     private String packagingMethod;
 	/**销售部门(sale department)*/
-	@Excel(name = "销售部门(sale department)", width = 15)
     @ApiModelProperty(value = "销售部门(sale department)")
     private String saleDepartment;
+    @Excel(name = "销售部门(sale department)", width = 15)
     private String saleDepartmentName;
 	/**业务员(salesman)*/
-	@Excel(name = "业务员(salesman)", width = 15)
     @ApiModelProperty(value = "业务员(salesman)")
     private String salesman;
+    @Excel(name = "业务员(salesman)", width = 15)
     private String salesmanName;
 	/**报价备注(quotation notes)*/
 	@Excel(name = "报价备注(quotation notes)", width = 15)
     @ApiModelProperty(value = "报价备注(quotation notes)")
     private String quotationNotes;
 	/**附件(attachs)*/
-	@Excel(name = "附件(attachs)", width = 15)
     @ApiModelProperty(value = "附件(attachs)")
     private String attachs;
 	/**供应商技术资料(supplier quotation attachs)*/
-	@Excel(name = "供应商技术资料(supplier quotation attachs)", width = 15)
     @ApiModelProperty(value = "供应商技术资料(supplier quotation attachs)")
     private String supplierAttachs;
 	/**版本号*/
@@ -187,11 +182,10 @@ public class SaleQuotation implements Serializable {
     @ApiModelProperty(value = "版本号")
     private String version;
 	/**邮箱发送*/
-	@Excel(name = "邮箱发送", width = 15)
     @ApiModelProperty(value = "邮箱发送")
     private String send;
     @ApiModelProperty(value = "来源")
-    private String sourceCode;
+    private String sourceCode;//报价选定
 
     @Excel(name = "汇率(exchangeRate)", width = 15)
     private BigDecimal exchangeRate;
@@ -203,8 +197,13 @@ public class SaleQuotation implements Serializable {
     @Excel(name = "销售金额合计", width = 15)
     private BigDecimal saleAmount;
 
+
     @ApiModelProperty(value = "整单毛利率(gross margin)")
     private java.math.BigDecimal grossMarginHead;
+    @Excel(name = "船", width = 15)
+    private String shipName;
+    @Excel(name = "imo", width = 15)
+    private String imo;
     //联系人主键
     private String liaisonId;
     //联系人信息
@@ -225,9 +224,6 @@ public class SaleQuotation implements Serializable {
     @TableField(exist = false)
     private String email;
 
-    private String shipName;
-    private String imo;
-
     @TableField(exist = false)
     private String qualityGrade;
     @TableField(exist = false)

+ 5 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleOrderPage.java

@@ -58,6 +58,11 @@ public class SaleOrderPage {
 	//联系人信息
 	private String liaisonInfo;
 
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern="yyyy-MM-dd")
+	@ApiModelProperty(value = "notified")
+	private Date notified;
+
 	/**创建时间*/
 	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
     @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")

+ 1 - 1
srm-module-code/src/main/java/org/jeecg/modules/saleCode/vo/SaleQuotationPage.java

@@ -115,7 +115,7 @@ public class SaleQuotationPage {
 	@ApiModelProperty(value = "优先级(priority)")
     private String priority;
 	/**产品分类(production class)*/
-	@Excel(name = "产品分类(production class)", width = 15)
+	@Excel(name = "产品分类(production class)", width = 15,dictTable = "base_product_class", dicCode = "id", dicText = "name")
 	@ApiModelProperty(value = "产品分类(production class)")
     private String productionClass;
 	/**机型(model)*/