ソースを参照

售后流程修改

liujiankang 5 年 前
コミット
8d7bce8ecb

+ 74 - 0
watero-rst-core/src/main/java/com.iamberry.rst.core/fm/ComplaintDetectInfo.java

@@ -43,6 +43,7 @@ public class ComplaintDetectInfo implements Serializable {
     private String questionTitle;//问题标题
     private String colorName;//产品颜色名称
     private String productName;//产品名称
+    private String productAbbreviation;//产品简称
 
     private Integer detectOffer;//维修报价
     private Integer detectRenovation;//是否可翻新 1可翻新 2不可翻新
@@ -91,6 +92,15 @@ public class ComplaintDetectInfo implements Serializable {
 
     private Integer adminId;//登录人id
 
+    private String startTime;
+    private String endTime;
+    private String todayTime;
+    private Integer status;//维修列表状态搜索
+
+    private Integer detectIsPrint;// 是否打印 1未打印 2已打印
+    private Date detectPrintTime;//首次打印时间
+    private String signclosedName;//签收人姓名
+
     public Integer getDetectId() {
         return detectId;
     }
@@ -562,4 +572,68 @@ public class ComplaintDetectInfo implements Serializable {
     public void setAdminId(Integer adminId) {
         this.adminId = adminId;
     }
+
+    public String getProductAbbreviation() {
+        return productAbbreviation;
+    }
+
+    public void setProductAbbreviation(String productAbbreviation) {
+        this.productAbbreviation = productAbbreviation;
+    }
+
+    public String getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime(String startTime) {
+        this.startTime = startTime;
+    }
+
+    public String getEndTime() {
+        return endTime;
+    }
+
+    public void setEndTime(String endTime) {
+        this.endTime = endTime;
+    }
+
+    public String getTodayTime() {
+        return todayTime;
+    }
+
+    public void setTodayTime(String todayTime) {
+        this.todayTime = todayTime;
+    }
+
+    public Integer getDetectIsPrint() {
+        return detectIsPrint;
+    }
+
+    public void setDetectIsPrint(Integer detectIsPrint) {
+        this.detectIsPrint = detectIsPrint;
+    }
+
+    public Date getDetectPrintTime() {
+        return detectPrintTime;
+    }
+
+    public void setDetectPrintTime(Date detectPrintTime) {
+        this.detectPrintTime = detectPrintTime;
+    }
+
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
+    public String getSignclosedName() {
+        return signclosedName;
+    }
+
+    public void setSignclosedName(String signclosedName) {
+        this.signclosedName = signclosedName;
+    }
 }

+ 5 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintDetectInfoService.java

@@ -173,4 +173,9 @@ public interface ComplaintDetectInfoService {
      * @return
      */
     ComplaintAfterSalesNum getCustomerDetectNum(ComplaintDetectInfo detect);
+    /**
+     * 修改打印状态
+     * @return
+     */
+    Integer updatePrint(ComplaintDetectInfo detectInfo);
 }

+ 2 - 2
watero-rst-interface/src/main/java/com/iamberry/rst/faces/fm/ComplaintSignclosedInfoService.java

@@ -18,7 +18,7 @@ public interface ComplaintSignclosedInfoService {
      * 添加单个签收记录
      * @return
      */
-    boolean insert(ComplaintSignclosedInfo record,String orderItemString,String[] componentsImgs);
+    Integer insert(ComplaintSignclosedInfo record,String orderItemString,String[] componentsImgs);
     /**
      * 查询单个签收记录
      * @return
@@ -66,7 +66,7 @@ public interface ComplaintSignclosedInfoService {
      * 添加品质信息
      * @return
      */
-    int addDetect(ComplaintSignclosedInfo record);
+    int addDetect(ComplaintSignclosedInfo record,Integer type);
 
     /**
      * 查询签收产品集合

+ 22 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintDetectInfoServiceImpl.java

@@ -183,10 +183,27 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
                     }
                     break;
                 default:
+                    String processingResults = "";
+                    String text = "";
                     if(record.getDetectRenovation() == 1){//是否可翻新 1可翻新 2不可翻新
                         record.setDetectState(20);//待翻新入库
+                        processingResults = "维修";
                     }else if(record.getDetectRenovation() == 2){
                         record.setDetectState(22);//不能翻新,待报废
+                        processingResults = "报废";
+                    }
+                    //查询维修编号
+                    ComplaintDetectInfo info = complaintDetectInfoMapper.getDetectById(record.getDetectId());
+                    //客诉状态为换货或退货时完成检测需要短信通知维修人员
+                    if(cmRelation.getProcTypeId() == 2){//换货
+                        text = MessageFormat.format(SmsConfig.CUSTOMER_EXCHANGE, info.getDetectNumber(),processingResults);
+                    }
+                    if(cmRelation.getProcTypeId() == 4){//退货
+                        text = MessageFormat.format(SmsConfig.CUSTOMER_RETURN, info.getDetectNumber(),processingResults);
+                    }
+                    if(cmRelation.getProcTypeId() == 2 || cmRelation.getProcTypeId() == 4){
+                        String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
+                        logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送完成检测结果("+processingResults+"):"+result);
                     }
             }
         }
@@ -484,5 +501,10 @@ public class ComplaintDetectInfoServiceImpl implements ComplaintDetectInfoServic
         return complaintDetectInfoMapper.getCustomerDetectNum(detect);
     }
 
+    @Override
+    public Integer updatePrint(ComplaintDetectInfo detectInfo) {
+        return complaintDetectInfoMapper.updateDetectById(detectInfo);
+    }
+
 
 }

+ 64 - 31
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/ComplaintSignclosedInfoServiceImpl.java

@@ -11,6 +11,7 @@ import com.iamberry.rst.core.order.ProductColor;
 import com.iamberry.rst.core.page.PageRequest;
 import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.fm.ComplaintSignclosedInfoService;
+import com.iamberry.rst.faces.sms.SmsService;
 import com.iamberry.rst.service.cm.mapper.*;
 import com.iamberry.rst.service.fm.mapper.AwaitingSignclosedProductMapper;
 import com.iamberry.rst.service.fm.mapper.ComplaintDetectInfoMapper;
@@ -19,11 +20,15 @@ import com.iamberry.rst.service.fm.mapper.ComplaintSignclosedProductInfoMapper;
 import com.iamberry.rst.service.product.mapper.ProductMapper;
 import com.iamberry.rst.util.PageUtil;
 import com.iamberry.rst.util.ProduceNoUtil;
+import com.iamberry.rst.util.SmsConfig;
 import net.sf.json.JSONArray;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.text.MessageFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -32,6 +37,7 @@ import java.util.Map;
 
 @Service
 public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedInfoService {
+    private Logger logger = LoggerFactory.getLogger(ComplaintSignclosedInfoServiceImpl.class);
     @Autowired
     private ComplaintSignclosedInfoMapper complaintSignclosedInfoMapper;
     @Autowired
@@ -46,23 +52,39 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
     private ComplaintDetectInfoMapper complaintDetectInfoMapper;
     @Autowired
     private CustomerInfoMapper customerInfoMapper;
+    @Autowired
+    private SmsService smsService;
 
     @Override
     @Transactional
-    public boolean insert(ComplaintSignclosedInfo record,
+    public Integer insert(ComplaintSignclosedInfo record,
                           String orderItemString,String[] componentsImgs) {
-        boolean msg = true;
+        Integer msg = 0;
         int num = 0;
         //查询是否已存在相同单号
         if(record.getSignclosedLogisticsNumber() != null){
             ComplaintSignclosedInfo info = new ComplaintSignclosedInfo();
             info.setSignclosedLogisticsNumber(record.getSignclosedLogisticsNumber());
-            if(complaintSignclosedInfoMapper.listSignclosed(info).size() <= 0){
+            List<ComplaintSignclosedInfo> sinfoList = complaintSignclosedInfoMapper.listSignclosed(info);
+            if(sinfoList.size() <= 0){
                 num = complaintSignclosedInfoMapper.insert(record);
+                msg = 1;//添加成功
+            }else{
+                //将签收记录改为已签收
+                ComplaintSignclosedInfo complaintSignclosedInfo = sinfoList.get(0);
+                if(complaintSignclosedInfo.getSignclosedIsReceiving() == 1){
+                    complaintSignclosedInfo.setSignclosedIsReceiving(2);
+                    complaintSignclosedInfo.setSignclosedDate(new Date());
+                    complaintSignclosedInfoMapper.updateSignclosedById(complaintSignclosedInfo);
+                    msg = 3;//已存在相同单号的签收信息并修改状态为已签收
+                }else{
+                    msg = 4;//已存在相同单号的已签收信息
+                }
+
             }
         }
         if(num < 1){
-            msg = false;
+            return msg;//新增签收失败
         }else{
             if(orderItemString != null){
                 JSONArray jsonArray = JSONArray.fromObject(orderItemString);
@@ -75,7 +97,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                             ProductColor productColor = productMapper.getProduceColor(salesOrderItem.getItemColorId());
                             Product product = productMapper.getProduce(productColor.getColorProductId());
                             if(productColor == null){
-                                msg = false;
+                                msg = 2;
                             }
                             signclosedProductInfo.setSignclosedId(record.getSignclosedId());
                             signclosedProductInfo.setProductName(productColor.getProductName());
@@ -128,7 +150,7 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
             }
             //关联客诉/判断是否生成客诉信息
             try {
-                addDetect(record);
+                addDetect(record,2);
             }catch (Exception e){
                 throw new RuntimeException("------------关联客诉出错------------");
             }
@@ -139,9 +161,10 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
     /**
      * 关联客诉
      * @param record
+     * type 1新增签收 2客服关联客诉
      * @return
      */
-    public int addDetect(ComplaintSignclosedInfo record){
+    public int addDetect(ComplaintSignclosedInfo record,Integer type){
             CustomerInfo customerInfo = new CustomerInfo();
             List<CustomerInfo> listCustomer = new ArrayList<>();
             if(record.getSignclosedCustomerId() != null){
@@ -213,37 +236,47 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
                 Integer msg = complaintSignclosedInfoMapper.updateSignclosedById(signclosedInfo);
 
             if(msg == 1){
-                addDet(record.getSignclosedId());
+                ComplaintSignclosedInfo infos = complaintSignclosedInfoMapper.getSignclosedById(record.getSignclosedId());
                 //判断是否需要生成维修记录
-                /*if(sigInfo.getSignclosedProductInfoList().size() > 0){
-                    for(SignclosedProductInfo productInfo : sigInfo.getSignclosedProductInfoList()){
+                if(infos.getSignclosedProductInfoList().size() > 0) {
+                    for (SignclosedProductInfo productInfo : infos.getSignclosedProductInfoList()) {
                         ProductColor productColor = productMapper.getProduceColor(productInfo.getSignclosedProductColor());
                         Product product = productMapper.getProduce(productColor.getColorProductId());
-                        if(product.getProductIsDetection() == 1){
-                            for (int j = 0;j<productInfo.getProductNum();j++){
-                                //添加待检测信息
-                                //查询签收信息
-                                ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
-                                detectInfo.setProductId(productColor.getColorProductId());
-                                detectInfo.setProductColorId(productInfo.getSignclosedProductColor());
-                                detectInfo.setDetectProductNumber(product.getProductNumber());
-                                detectInfo.setDetectState(1);
-                                detectInfo.setCustomerId(signclosedInfo.getSignclosedCustomerId());
-                                detectInfo.setIsMaintenance(0);
-                                detectInfo.setDetectRenovation(0);
-                                detectInfo.setDetectProcessingResults(0);
-                                try {
-                                    complaintDetectInfoMapper.insert(detectInfo);
-                                }catch (Exception e){
-                                    throw new RuntimeException("------------生成检测信息出错------------");
+                        if(product.getProductIsDetection() != null){
+                            if (product.getProductIsDetection() == 1) {
+                                for (int j = 0; j < productInfo.getProductNum(); j++) {
+                                    //添加待检测信息
+                                    //查询签收信息
+                                    ComplaintDetectInfo detectInfo = new ComplaintDetectInfo();
+                                    //生成维修编号
+                                    String number = detectNumber();
+                                    detectInfo.setDetectNumber(number);
+                                    detectInfo.setProductId(productColor.getColorProductId());
+                                    detectInfo.setProductColorId(productInfo.getSignclosedProductColor());
+                                    detectInfo.setDetectProductNumber(product.getProductNumber());
+                                    detectInfo.setDetectState(1);
+                                    detectInfo.setCustomerId(infos.getSignclosedCustomerId());
+                                    detectInfo.setIsMaintenance(0);
+                                    detectInfo.setDetectRenovation(0);
+                                    detectInfo.setDetectProcessingResults(0);
+                                    detectInfo.setSignclosedId(infos.getSignclosedId());
+                                    try {
+                                        complaintDetectInfoMapper.insert(detectInfo);
+                                        if(type == 1){//客服关联客诉才发送通知短信
+                                            //发送短信通知维修检测人员
+                                            String text = MessageFormat.format(SmsConfig.CUSTOMER_CONTACT, sigInfo.getSignclosedLogisticsNumber(),number);
+                                            String result = smsService.sendOtherCMS(SmsConfig.CUSTOMER_PHONE, text);
+                                            logger.info("给 " + SmsConfig.CUSTOMER_PHONE + " 手机用户发送短信:" + text+"发送关联客诉通知维修人员:"+result);
+                                        }
+
+                                    } catch (Exception e) {
+                                        throw new RuntimeException("------------生成检测信息出错------------");
+                                    }
                                 }
                             }
                         }
-
                     }
-
-                }*/
-
+                }
             }
         }
         return 1;

+ 54 - 3
watero-rst-service/src/main/java/com/iamberry/rst/service/fm/mapper/complaintDetectInfoMapper.xml

@@ -47,7 +47,9 @@
       ac.city signclosedAddrCityName,
       ad.district signclosedAddrAreaName,
       cs.signclosed_date signclosedDate,
-      cs.signclosed_logistics_number logisticsNumber
+      cs.signclosed_logistics_number logisticsNumber,
+      cd.detect_is_print detectIsPrint,
+      cd.detect_print_time detectPrintTime
     from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id
     LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
@@ -118,6 +120,7 @@
     cd.complete_cut_time completeCutTime,
     qd.describe_title questionTitle,
     pi.product_name productName,
+    pi.product_abbreviation productAbbreviation,
     pt.type_name productTypeName,
     ci.color_name colorName,
     cpm.proc_method_name procMethodName,
@@ -128,7 +131,10 @@
     ad.district signclosedAddrAreaName,
     cs.signclosed_date signclosedDate,
     c.customer_create_time customerCreateTime,
-    cs.signclosed_logistics_number logisticsNumber
+    cs.signclosed_logistics_number logisticsNumber,
+    cd.detect_is_print detectIsPrint,
+    cd.detect_print_time detectPrintTime,
+    cs.signclosed_send_name signclosedName
     from tb_rst_complaint_detect cd
     LEFT JOIN tb_rst_product_info pi ON cd.product_id = pi.product_id
     LEFT JOIN tb_rst_cm_question_describe qd on cd.customer_id = qd.customer_id
@@ -215,6 +221,45 @@
       <if test="signclosedDate != null and signclosedDate != ''" >
         AND cs.signclosed_date = #{signclosedDate}
       </if>
+      <if test="startTime != null and startTime != ''" >
+        AND cd.detect_create_time &gt; #{startTime}
+      </if>
+      <if test="endTime != null and endTime != ''" >
+        AND cd.detect_create_time  &lt; #{endTime}
+      </if>
+      <if test="todayTime != null and todayTime != ''" >
+        AND to_days(cd.detect_create_time) = to_days(now())
+      </if>
+      <if test="detectIsPrint != null and detectIsPrint != ''" >
+        AND cd.detect_is_print  = #{detectIsPrint}
+      </if>
+      <if test="status != null and status == 1">
+        and cd.detect_state = 1
+      </if>
+      <if test="status != null and status == 2">
+        and cd.detect_state in(30,34,38)
+      </if>
+      <if test="status != null and status == 3">
+        and cd.detect_state in(31,35)
+      </if>
+      <if test="status != null and status == 4">
+        and cd.detect_state  = 20
+      </if>
+      <if test="status != null and status == 5">
+        and cd.detect_state  = 22
+      </if>
+      <if test="status != null and status == 6">
+        and cd.detect_state in(32,36)
+      </if>
+      <if test="status != null and status == 7">
+        and cd.detect_state = 21
+      </if>
+      <if test="status != null and status == 8">
+        and cd.detect_state = 23
+      </if>
+      <if test="signclosedName != null and signclosedName != ''">
+        and cs.signclosed_send_name  like CONCAT('%',#{signclosedName},'%')
+      </if>
     </where>
       GROUP BY cd.detect_id
       ORDER BY cd.detect_create_time DESC
@@ -299,7 +344,13 @@
           detect_number = #{detectNumber,jdbcType=VARCHAR},
       </if>
       <if test="completeCutTime != null and completeCutTime != ''" >
-        complete_cut_time = #{completeCutTime,jdbcType=VARCHAR}
+        complete_cut_time = #{completeCutTime,jdbcType=VARCHAR},
+      </if>
+      <if test="detectIsPrint != null and detectIsPrint != ''" >
+        detect_is_print = #{detectIsPrint,jdbcType=INTEGER},
+      </if>
+      <if test="detectPrintTime != null and detectPrintTime != ''" >
+        detect_print_time = #{detectPrintTime,jdbcType=TIMESTAMP}
       </if>
     </set>
     where

+ 6 - 0
watero-rst-service/src/main/java/com/iamberry/rst/util/SmsConfig.java

@@ -75,6 +75,9 @@ public class SmsConfig {
     /* 客服确认售后处理结果短信模板及手机号 */
     public static String CUSTOMER_CONFIRM="";
     public static String CUSTOMER_PHONE="";
+    public static String CUSTOMER_EXCHANGE="";
+    public static String CUSTOMER_RETURN="";
+    public static String CUSTOMER_CONTACT="";
 
 
 
@@ -126,6 +129,9 @@ public class SmsConfig {
             scanningQrCode=pro.getProperty("scanningQrCode");
             CUSTOMER_CONFIRM=pro.getProperty("CUSTOMER_CONFIRM");
             CUSTOMER_PHONE=pro.getProperty("CUSTOMER_PHONE");
+            CUSTOMER_EXCHANGE=pro.getProperty("CUSTOMER_EXCHANGE");
+            CUSTOMER_RETURN=pro.getProperty("CUSTOMER_RETURN");
+            CUSTOMER_CONTACT=pro.getProperty("CUSTOMER_CONTACT");
         } catch (Exception e) {
             e.printStackTrace();
         }

+ 164 - 4
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminDetectController.java

@@ -110,10 +110,6 @@ public class AdminDetectController {
         ModelAndView mv = new ModelAndView("cm/inspection/detect_list");
 
         SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-        String signclosedDate = request.getParameter("signclosed_date");
-        if(signclosedDate != null && !signclosedDate.equals("")){
-            detect.setSignclosedDate(sdf.parse(signclosedDate));
-        }
         // 封装请求数据
         PageRequest<ComplaintDetectInfo> pageRequest = new PageRequest<>(detect, pageNO, pageSize, totalNum == 0);
         // 查询订单列表
@@ -968,5 +964,169 @@ public class AdminDetectController {
                 bos.close();
         }
     }
+
+    /**
+     * 进入导出每日检测页面
+     */
+    @RequestMapping(value = "/to_download_detection")
+    public ModelAndView toDownloadDetection(HttpServletRequest request) {
+        ModelAndView mv = new ModelAndView("cm/inspection/download_detection");
+        return mv;
+    }
+
+    /**
+     * 导出维修信息
+     * @param request
+     * @param res
+     * @param detectInfo
+     * @throws Exception
+     */
+    @RequestMapping("/download_detection")
+    public void downloadDetection(HttpServletRequest request,HttpServletResponse res
+            , ComplaintDetectInfo detectInfo) throws Exception{
+        //根据id查询订单数据
+        if((detectInfo.getStartTime() == null || detectInfo.getStartTime().equals("")) && (detectInfo.getEndTime() == null  || detectInfo.getEndTime().equals(""))){
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            Calendar date = Calendar.getInstance();
+            date.setTime(new Date());
+            detectInfo.setTodayTime(sdf.format(date.getTime()));
+        }
+        List<ComplaintDetectInfo> detectList = complaintDetectInfoService.listComplaintDetect(detectInfo);
+        /*if (detectList == null || detectList.size() == 0) {
+            return;
+        }*/
+        String[] cells = {
+                "维修编号","快递单号","产品简称","产品颜色","生产月份","机身条码",
+                "退货地区","返厂日期","售后处理类型","工厂检测现象","是否翻新机","厚膜类型","浮子类型","版本号","检测日期"
+        };
+        exportExcel2(request,res,cells,detectList);
+    }
+    /**
+     * 导出订单Excel并下载
+     * @param request
+     * @param res
+     * @param cells
+     * @param detectList
+     * @throws Exception
+     */
+    public void exportExcel2(HttpServletRequest request,HttpServletResponse res,
+                            String[] cells,List<ComplaintDetectInfo> detectList) throws Exception {
+        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+        //创建一个workbook,对应一个Excel文件
+        HSSFWorkbook wb = new HSSFWorkbook();
+        //在workbook中添加一个sheet,对应Excel中的一个sheet
+        HSSFSheet sheet = wb.createSheet("导出维修");
+        //在sheet中添加表头第0行,老版本poi对excel行数列数有限制short
+        HSSFRow row = sheet.createRow((int) 0);
+        //创建单元格,设置值表头,设置表头居中
+        HSSFCellStyle style = wb.createCellStyle();
+        //居中格式
+        style.setAlignment(HSSFCellStyle.ALIGN_CENTER);
+        //设置表头
+
+        if (cells == null || cells.length == 0) {
+            return;
+        }
+        //循环设置表头
+        HSSFCell cell = null;
+        for (int i = 0;i < cells.length;i++) {
+            String name = cells[i];
+            cell = row.createCell(i);
+            cell.setCellValue(name);
+            cell.setCellStyle(style);
+        }
+        for (int i = 0; i < detectList.size(); i++) {
+            row = sheet.createRow((int) i + 1);
+            ComplaintDetectInfo detect = detectList.get(i);
+            String detectFilmType = "";
+            if(detect.getDetectFilmType() != null){
+                switch (detect.getDetectFilmType()) {
+                    case 1:detectFilmType = "圆";break;
+                    case 2:detectFilmType = "扁";break;
+                }
+            }
+            String detectIsRefurbishing = "";
+            if(detect.getDetectIsRefurbishing() != null){
+                switch (detect.getDetectIsRefurbishing()) {
+                    case 1:detectIsRefurbishing = "是";break;
+                    case 2:detectIsRefurbishing = "否";break;
+                }
+            }
+            String detectFloatType = "";
+            if(detect.getDetectFloatType() != null){
+                switch (detect.getDetectFloatType()) {
+                    case 1:detectFloatType = "长";break;
+                    case 2:detectFloatType = "短";break;
+                }
+            }
+            // 创建单元格,设置值
+            row.createCell(0).setCellValue(detect.getDetectNumber()==null?"":detect.getDetectNumber());
+            row.createCell(1).setCellValue(detect.getLogisticsNumber()==null?"":detect.getLogisticsNumber());
+            row.createCell(2).setCellValue(detect.getProductAbbreviation()==null?"":detect.getProductAbbreviation());
+            row.createCell(3).setCellValue(detect.getColorName()==null?"":detect.getColorName());
+            row.createCell(4).setCellValue(detect.getDetectProduction()==null?"":detect.getDetectProduction());
+            row.createCell(5).setCellValue(detect.getDetectFuselageBarcode()==null?"":detect.getDetectFuselageBarcode());
+            StringBuffer area = new StringBuffer(" ");
+            if(detect.getSignclosedAddrProvincesName() == null || detect.getSignclosedAddrProvincesName().equals("")){
+                area.append("");
+            }else{
+                area.append(detect.getSignclosedAddrProvincesName());
+            }
+            if(detect.getSignclosedAddrCityName() == null || detect.getSignclosedAddrCityName().equals("")){
+                area.append("");
+            }else{
+                area.append("-"+detect.getSignclosedAddrCityName());
+            }
+            row.createCell(6).setCellValue(area.toString());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
+            if(detect.getSignclosedDate()==null){
+                row.createCell(7).setCellValue( "");
+            }else{
+                row.createCell(7).setCellValue(sdf.format(detect.getSignclosedDate()));
+            }
+            /*row.createCell(9).setCellValue(detect.getProcTypeName()==null?"":detect.getProcTypeName());*/
+            row.createCell(8).setCellValue(detect.getProcMethodName()==null?"":detect.getProcMethodName());
+            row.createCell(9).setCellValue(detect.getDetectPhenomenon()==null?"":detect.getDetectPhenomenon());
+            row.createCell(10).setCellValue(detectIsRefurbishing);
+            row.createCell(11).setCellValue(detectFilmType);
+            row.createCell(12).setCellValue(detectFloatType);
+            row.createCell(13).setCellValue(detect.getDetectVersionNumber()==null?"":detect.getDetectVersionNumber());
+            if(detect.getDetectPrintTime()==null){
+                row.createCell(14).setCellValue( "");
+            }else{
+                row.createCell(14).setCellValue(sdf.format(detect.getDetectPrintTime()));
+            }
+        }
+        //下载导出订单Excel
+        downloadOrderExcel(res,wb);
+    }
+
+    /**
+     * 修改打印状态
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/update_print")
+    public ResponseJson updatePrint(HttpServletRequest request,ComplaintDetectInfo complaintDetectInfo){
+        ResponseJson msg = new ResponseJson();
+        if(complaintDetectInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        complaintDetectInfo.setDetectIsPrint(2);
+        complaintDetectInfo.setDetectPrintTime(new Date());
+        Integer num = complaintDetectInfoService.updatePrint(complaintDetectInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
+
 }
 

+ 4 - 13
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -52,8 +52,6 @@ public class AdminSignclosedController {
     private LogisticsInfoService logisticsInfoService;
     @Autowired
     private CompanyInfoService companyInfoService;
-    @Autowired
-    private ComplaintSignclosedProductInfoService complaintSignclosedProductInfoService;
 
     /**
      * 跳转到添加签收记录页面
@@ -189,16 +187,9 @@ public class AdminSignclosedController {
         }
         signclosedInfo.setSignclosedCreateTime(new Date());
         signclosedInfo.setSignclosedIsReceiving(2);
-        boolean num = complaintSignclosedInfoService.insert(signclosedInfo,orderItemString,componentsImgs);
-
-
-        if (!num) {
-            msg.setResultCode(200);
-            msg.setReturnCode(500);
-        } else {
-            msg.setResultCode(200);
-            msg.setReturnCode(200);
-        }
+        Integer num = complaintSignclosedInfoService.insert(signclosedInfo,orderItemString,componentsImgs);
+        msg.setResultCode(200);
+        msg.setReturnCode(num);
         return msg;
     }
 
@@ -449,7 +440,7 @@ public class AdminSignclosedController {
             return msg;
         }
 
-        int num = complaintSignclosedInfoService.addDetect(signclosedInfo);
+        int num = complaintSignclosedInfoService.addDetect(signclosedInfo,1);
         if (num < 1) {
             msg.setResultCode(500);
             msg.setReturnCode(500);

+ 4 - 1
watero-rst-web/src/main/resources/platform.properties

@@ -63,7 +63,10 @@ ADD_CUSTOMER_SUCCESS_AIBERLE=\u3010\u7231\u8D1D\u6E90\u3011\u5C0A\u656C\u7684\u5
 
 REMIND_POSTAGE_PENDING=\u3010\u7231\u8D1D\u6E90RST\u3011\u60A8\u6709{0}\u4E2A\u90AE\u8D39\u7533\u8BF7\u5F85\u5904\u7406\uFF0C\u8BF7\u5C3D\u5FEB\u524D\u5F80RST\u7CFB\u7EDF\u5904\u7406
 CUSTOMER_CONFIRM=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u5ba2\u670d\u5df2\u7ecf\u786e\u8ba4\uff0c\u6b64\u673a\u5668\u5df2\u7ecf\u786e\u8ba4{1}
-CUSTOMER_PHONE=18318941947
+CUSTOMER_PHONE=15207170059
+CUSTOMER_EXCHANGE=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u8bf7\u5f00\u59cb{1}\uff0c\u6b64\u4e3a\u6362\u8d27\u673a\u5668\uff0c\u8bf7\u5f00\u59cb\u5904\u7406\uff1b
+CUSTOMER_RETURN=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u8bf7\u5f00\u59cb{1}\uff0c\u6b64\u4e3a\u9000\u8d27\u673a\u5668\uff0c\u8bf7\u5f00\u59cb\u5904\u7406\uff1b
+CUSTOMER_CONTACT=\u3010\u7231\u8d1d\u6e90RST\u3011{0}\u5ba2\u670d\u5df2\u7ecf\u786e\u8ba4\uff0c\u7ef4\u4fee\u7f16\u53f7\u4e3a{1}\uff0c\u8bf7\u6253\u5370\u6b64\u673a\u5668\u7ef4\u4fee\u5361\u5e76\u5f00\u59cb\u68c0\u6d4b\uff1b
 #---SMS end---#
 
 # token

ファイルの差分が大きいため隠しています
+ 69 - 39
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/detect_list.ftl


ファイルの差分が大きいため隠しています
+ 64 - 0
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/download_detection.ftl


+ 3 - 3
watero-rst-web/src/main/webapp/WEB-INF/views/cm/inspection/update_complete.ftl

@@ -290,13 +290,13 @@
                 <input class="my-input" style="width: 90%;" type="text" value="${detectInfo.detectNalysis!''}" name="detectNalysis" id="detectNalysis"  placeholder="请输入原因分析"/>
             </div>
         </div>-->
-        <div class="input-box">
+        <#--<div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;">故障分类:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">
-            <#--<textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectClassification" id="detectClassification" class="my-textarea" placeholder="请输入故障分类">${detectInfo.detectClassification!''}</textarea>-->
+            &lt;#&ndash;<textarea style="margin-left: 0%;width: 83%;" rows="2" cols="20" name="detectClassification" id="detectClassification" class="my-textarea" placeholder="请输入故障分类">${detectInfo.detectClassification!''}</textarea>&ndash;&gt;
                 <input class="my-input" style="width: 90%;" type="text" value="${detectInfo.detectClassification!''}" name="detectClassification" id="detectClassification"  placeholder="请输入故障分类"/>
             </div>
-        </div>
+        </div>-->
     <#--    <div class="input-box">
             <label class="col-3 col-sm-3 huanhang" style="text-align: right;margin: 10px 0px;">检测内容:</label>
             <div class="formControls col-xs-9 col-sm-9 skin-minimal huanhang" style="margin: 10px 0px;">

+ 16 - 8
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/add_signclosed.ftl

@@ -456,21 +456,29 @@
             data:$('#form-signclosed-add').serialize(),// 你的formid
             async: false,
             success: function(data){
-                if (data.returnCode == 200) {
+                if (data.returnCode === 1) {
                     layer.msg('签收成功',{icon: 1,time:1000},function () {
                         location.replace(location.href);
                         window.location.href= "${path}/admin/signclosed/select_signclosed_list";
                     });
-                } else if(data.returnCode == 502) {
-                    layer.msg('请至少选择一件已签收的产品',{icon: 5,time:1000});
-                } else if(data.returnCode == 503) {
-                    layer.msg('有产品数量未填写,如本次签收没有此产品,请删除',{icon: 5,time:1000});
-                }else{
-                    layer.msg('添加失败,核实是否已存在该单号!',{icon: 5,time:1000});
+                } else if(data.returnCode === 0) {
+                    layer.msg('添加失败',{icon: 5,time:2000});
+                } else if(data.returnCode === 2) {
+                    layer.msg('添加失败,缺少产品颜色信息',{icon: 5,time:4000});
+                } else if(data.returnCode === 3) {
+                    layer.msg('已存在相同单号的签收信息并已将签收状态改为已签收',{icon: 5,time:5000},function () {
+                        location.replace(location.href);
+                        window.location.href= "${path}/admin/signclosed/select_signclosed_list";
+                    });
+                } else if(data.returnCode === 4) {
+                    layer.msg('已存在相同单号的已签收信息',{icon: 5,time:5000},function () {
+                        location.replace(location.href);
+                        window.location.href= "${path}/admin/signclosed/select_signclosed_list";
+                    });
                 }
             },
             error: function(XmlHttpRequest, textStatus, errorThrown){
-                layer.msg('添加错误',{icon: 5,time:1000});
+                layer.msg('添加错误',{icon: 5,time:2000});
             }
         });
     }