Browse Source

Merge branch 'master' of http://git.iamberry.com/hexiugang/iamberry-common-parent

wangxiaoming 7 years ago
parent
commit
fc39dd8525
20 changed files with 508 additions and 50 deletions
  1. 9 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintMaintenanceInfoService.java
  2. 6 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintSignclosedInfoService.java
  3. 3 0
      watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineService.java
  4. 14 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintMaintenanceInfoServiceImpl.java
  5. 23 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintSignclosedInfoServiceImpl.java
  6. 10 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/ComplaintMaintenanceInfoMapper.java
  7. 12 13
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml
  8. 48 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintMaintenanceInfoMapper.xml
  9. 13 4
      watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintQuestionInfoMapper.xml
  10. 1 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachinePartsServiceImpl.java
  11. 5 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineServiceImpl.java
  12. 2 1
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/MachineMapper.java
  13. 26 0
      watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml
  14. 26 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java
  15. 146 0
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintMaintenanceController.java
  16. 49 1
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintQuestionInfoController.java
  17. 7 7
      watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachinePartsController.java
  18. 38 4
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/signclosed_list.ftl
  19. 10 11
      watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/update_sender.ftl
  20. 60 8
      watero-rst-web/src/main/webapp/WEB-INF/views/pts/machinePtras/parts_list.ftl

+ 9 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintMaintenanceInfoService.java

@@ -1,6 +1,9 @@
 package com.iamberry.rst.faces.cm;
 
 import com.iamberry.rst.core.cm.ComplaintMaintenanceInfo;
+import com.iamberry.rst.core.cm.ComplaintSignclosedInfo;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
 
 /**
  * 客诉-生产维修Service
@@ -21,4 +24,10 @@ public interface ComplaintMaintenanceInfoService {
      * @return
      */
     int updateMaintenanceById(ComplaintMaintenanceInfo record);
+
+    /**
+     * 查询多个品质检测产品
+     * @return
+     */
+    PagedResult<ComplaintMaintenanceInfo> listMaintenance(PageRequest<ComplaintMaintenanceInfo> pageRequest);
 }

+ 6 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/cm/ComplaintSignclosedInfoService.java

@@ -50,4 +50,10 @@ public interface ComplaintSignclosedInfoService {
      * @return
      */
     PagedResult<ComplaintSignclosedInfo> listSignclosed(PageRequest<ComplaintSignclosedInfo> pageRequest);
+
+    /**
+     * 转入品质
+     * @return
+     */
+    int intoComplaint(Integer signclosedId);
 }

+ 3 - 0
watero-rst-interface/src/main/java/com/iamberry/rst/faces/pts/MachineService.java

@@ -56,6 +56,9 @@ public interface MachineService {
     //查询单个机器信息
     PtsMachine getMachine(Integer machineId);
 
+    //根据barcode查询单个机器信息
+    PtsMachine getMachineByBarCode(String machineBarcode);
+
     //查询每月机器台数 ,参数格式:2017-09
     Integer selectMonthCount(String yearMonth);
 

+ 14 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintMaintenanceInfoServiceImpl.java

@@ -1,15 +1,22 @@
 package com.iamberry.rst.service.cm;
 
 
+import com.github.pagehelper.PageHelper;
 import com.iamberry.rst.core.cm.ComplaintDetectInfo;
 import com.iamberry.rst.core.cm.ComplaintMaintenanceInfo;
+import com.iamberry.rst.core.cm.ComplaintSignclosedInfo;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
 import com.iamberry.rst.faces.cm.ComplaintDetectInfoService;
 import com.iamberry.rst.faces.cm.ComplaintMaintenanceInfoService;
 import com.iamberry.rst.service.cm.mapper.ComplaintDetectInfoMapper;
 import com.iamberry.rst.service.cm.mapper.ComplaintMaintenanceInfoMapper;
+import com.iamberry.rst.util.PageUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.util.List;
+
 @Service
 public class ComplaintMaintenanceInfoServiceImpl implements ComplaintMaintenanceInfoService {
     @Autowired
@@ -29,4 +36,11 @@ public class ComplaintMaintenanceInfoServiceImpl implements ComplaintMaintenance
     public int updateMaintenanceById(ComplaintMaintenanceInfo record) {
         return complaintMaintenanceInfoMapper.updateMaintenanceById(record);
     }
+
+    @Override
+    public PagedResult<ComplaintMaintenanceInfo> listMaintenance(PageRequest<ComplaintMaintenanceInfo> pageRequest) {
+        PageHelper.startPage(pageRequest.getPageNO(), pageRequest.getPageSize(), pageRequest.isPageTotal());
+        List<ComplaintMaintenanceInfo> signclosedList = complaintMaintenanceInfoMapper.listMaintenance(pageRequest.getData());
+        return PageUtil.getPage(signclosedList);
+    }
 }

+ 23 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/ComplaintSignclosedInfoServiceImpl.java

@@ -31,6 +31,8 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
     private ComplaintSignclosedProductInfoMapper complaintSignclosedProductInfoMapper;
     @Autowired
     private FittingsInfoMapper fittingsInfoMapper;
+    @Autowired
+    private ComplaintDetectInfoMapper complaintDetectInfoMapper;
 
     @Override
     @Transactional
@@ -214,4 +216,25 @@ public class ComplaintSignclosedInfoServiceImpl implements ComplaintSignclosedIn
 
     }
 
+    @Override
+    public int intoComplaint(Integer signclosedId) {
+        Integer msg = 0;
+        try {
+            ComplaintSignclosedInfo info = complaintSignclosedInfoMapper.getSignclosedById(signclosedId);
+            ComplaintDetectInfo complaintDetectInfo = new ComplaintDetectInfo();
+            complaintDetectInfo.setSignclosedId(info.getSignclosedId());
+            complaintDetectInfo.setDetectState(2);
+            msg = complaintDetectInfoMapper.updateComplaintDetectById(complaintDetectInfo);
+            if(msg != 0){
+                ComplaintSignclosedInfo complaintSignclosedInfo = new ComplaintSignclosedInfo();
+                complaintSignclosedInfo.setSignclosedId(info.getSignclosedId());
+                complaintSignclosedInfo.setSignclosedIsInto(1);
+                complaintSignclosedInfoMapper.updateSignclosedById(complaintSignclosedInfo);
+            }
+        }catch(Exception e) {
+            return msg;
+        }
+        return msg;
+    }
+
 }

+ 10 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/ComplaintMaintenanceInfoMapper.java

@@ -1,6 +1,10 @@
 package com.iamberry.rst.service.cm.mapper;
 
 import com.iamberry.rst.core.cm.ComplaintMaintenanceInfo;
+import com.iamberry.rst.core.cm.ComplaintSignclosedInfo;
+
+import java.util.List;
+
 /**
  * 客诉-生产维修mapper
  */
@@ -20,4 +24,10 @@ public interface ComplaintMaintenanceInfoMapper {
      * @return
      */
     int updateMaintenanceById(ComplaintMaintenanceInfo record);
+
+    /**
+     * 查询多个品质检测产品
+     * @return
+     */
+    List<ComplaintMaintenanceInfo> listMaintenance(ComplaintMaintenanceInfo record);
 }

+ 12 - 13
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintDetectInfoMapper.xml

@@ -14,7 +14,6 @@
     <result column="detect_results" property="detectResults" jdbcType="VARCHAR" />
     <result column="detect_point" property="detectPoint" jdbcType="VARCHAR" />
     <result column="detect_analysis" property="detectAnalysis" jdbcType="VARCHAR" />
-    <result column="detect_customer_id" property="detectCustomerId" jdbcType="INTEGER" />
     <result column="detect_revolution_produced" property="detectRevolutionProduced" jdbcType="BIT" />
     <result column="detect_desc" property="detectDesc" jdbcType="VARCHAR" />
     <result column="signclosed_create_time" property="signclosedCreateTime" jdbcType="TIMESTAMP" />
@@ -27,7 +26,7 @@
   <sql id="Base_Column_List" >
     detect_id, customer_id,signclosed_id,product_id,detect_product_number, detect_state,
     detect_phenomenon, detect_failure_classification, detect_failure_cause, detect_results, 
-    detect_point, detect_analysis, detect_customer_id, detect_revolution_produced, detect_desc, 
+    detect_point, detect_analysis, detect_revolution_produced, detect_desc,
     signclosed_create_time, signclosed_update_time,detect_is_maintenance,detect_date,maintenance_results
   </sql>
   <select id="getComplaintDetectById" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
@@ -51,7 +50,6 @@
       cd.detect_results detectResults,
       cd.detect_point detectPoint,
       cd.detect_analysis detectAnalysis,
-      cd.detect_customer_id detectCustomerId,
       cd.detect_revolution_produced detectRevolutionProduced,
       cd.detect_desc detectDesc,
       cd.signclosed_create_time signclosedCreateTime,
@@ -89,9 +87,6 @@
       <if test="detectAnalysis != null and detectAnalysis != ''" >
         AND cd.detect_analysis like CONCAT('%',#{detectAnalysis,jdbcType=VARCHAR},'%')
       </if>
-      <if test="detectCustomerId != null and detectCustomerId != ''" >
-        AND cd.detect_customer_id = #{detectCustomerId,jdbcType=INTEGER}
-      </if>
       <if test="detectRevolutionProduced != null and detectRevolutionProduced != ''" >
         AND cd.detect_revolution_produced = #{detectRevolutionProduced,jdbcType=BIT}
       </if>
@@ -107,8 +102,8 @@
     insert into tb_rst_complaint_detect (detect_id, customer_id,signclosed_id,product_id,
       detect_product_number, detect_state, detect_phenomenon, 
       detect_failure_classification, detect_failure_cause, 
-      detect_results, detect_point, detect_analysis, 
-      detect_customer_id, detect_revolution_produced, 
+      detect_results, detect_point, detect_analysis,
+      detect_revolution_produced,
       detect_desc, signclosed_create_time, signclosed_update_time,
       machine_no,detect_is_maintenance,detect_date,maintenance_results
       )
@@ -117,7 +112,7 @@
       #{detectProductNumber,jdbcType=VARCHAR}, #{detectState,jdbcType=BIT}, #{detectPhenomenon,jdbcType=VARCHAR}, 
       #{detectFailureClassification,jdbcType=VARCHAR}, #{detectFailureCause,jdbcType=VARCHAR}, 
       #{detectResults,jdbcType=VARCHAR}, #{detectPoint,jdbcType=VARCHAR}, #{detectAnalysis,jdbcType=VARCHAR}, 
-      #{detectCustomerId,jdbcType=INTEGER}, #{detectRevolutionProduced,jdbcType=BIT}, 
+      #{detectRevolutionProduced,jdbcType=BIT},
       #{detectDesc,jdbcType=VARCHAR}, #{signclosedCreateTime,jdbcType=TIMESTAMP}, #{signclosedUpdateTime,jdbcType=TIMESTAMP}
       ,#{machineNo,jdbcType=VARCHAR},#{detectIsMaintenance,jdbcType=BIT},#{detectDate,jdbcType=DATE},#{maintenanceResults,jdbcType=BIT}
       )
@@ -153,9 +148,6 @@
       <if test="detectAnalysis != null" >
         detect_analysis = #{detectAnalysis,jdbcType=VARCHAR},
       </if>
-      <if test="detectCustomerId != null" >
-        detect_customer_id = #{detectCustomerId,jdbcType=INTEGER},
-      </if>
       <if test="detectRevolutionProduced != null" >
         detect_revolution_produced = #{detectRevolutionProduced,jdbcType=BIT},
       </if>
@@ -172,6 +164,13 @@
         maintenance_results = #{maintenanceResults,jdbcType=BIT}
       </if>
     </set>
-    where detect_id = #{detectId,jdbcType=INTEGER}
+    <where>
+      <if test="detectId != null and detectId != ''" >
+        AND detect_id = #{detectId,jdbcType=INTEGER}
+      </if>
+      <if test="signclosedId != null and signclosedId != ''" >
+        AND signclosed_id = #{signclosedId,jdbcType=INTEGER}
+      </if>
+    </where>
   </update>
 </mapper>

+ 48 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintMaintenanceInfoMapper.xml

@@ -27,6 +27,54 @@
     from tb_rst_complaint_maintenance
     where maintenance_id = #{maintenanceId,jdbcType=INTEGER}
   </select>
+  <select id="listMaintenance" resultMap="BaseResultMap" parameterType="ComplaintMaintenanceInfo" >
+    select
+    maintenance_id maintenanceId,
+    detect_id detectId,
+    maintenance_equipment_number maintenanceEquipmentNumber,
+    product_id productId,
+    maintenance_product_number maintenanceProductNumber,
+    maintenance_state maintenanceState,
+    maintenance_analysis maintenanceAnalysis,
+    maintenance_customer_id maintenanceCustomerId,
+    maintenance_id_repair maintenanceIdRepair,
+    maintenance_content_date maintenanceContentDate,
+    maintenance_create_time maintenanceCreateTime,
+    maintenance_update_time maintenanceUpdateTime
+    from tb_rst_complaint_maintenance
+    <where>
+      <if test="maintenanceId != null and maintenanceId != ''" >
+        AND maintenance_id = #{maintenanceId}
+      </if>
+      <if test="detectId != null and detectId != ''" >
+        AND detect_id = #{detectId}
+      </if>
+      <if test="maintenanceEquipmentNumber != null maintenanceEquipmentNumber != ''" >
+        AND maintenance_equipment_number = #{maintenanceEquipmentNumber}
+      </if>
+      <if test="maintenanceState != null maintenanceState != ''" >
+        AND maintenance_state = #{maintenanceEquipmentNumber}
+      </if>
+      <if test="maintenanceAnalysis != null maintenanceAnalysis != ''" >
+        AND maintenance_analysis = #{maintenanceAnalysis}
+      </if>
+      <if test="maintenanceCustomerId != null maintenanceCustomerId != ''" >
+        AND maintenance_customer_id = #{maintenanceCustomerId}
+      </if>
+      <if test="maintenanceIdRepair != null maintenanceIdRepair != ''" >
+        AND maintenance_id_repair = #{maintenanceIdRepair}
+      </if>
+      <if test="maintenanceContentDate != null maintenanceContentDate != ''" >
+        AND maintenance_content_date = #{maintenanceContentDate}
+      </if>
+      <if test="maintenanceCreateTime != null maintenanceCreateTime != ''" >
+        AND maintenance_create_time = #{maintenanceCreateTime}
+      </if>
+      <if test="maintenanceUpdateTime != null maintenanceUpdateTime != ''" >
+        AND maintenanceUpdateTime = #{maintenanceUpdateTime}
+      </if>
+    </where>
+  </select>
   <insert id="insert" parameterType="ComplaintMaintenanceInfo" >
     insert into tb_rst_complaint_maintenance (maintenance_id, detect_id, maintenance_equipment_number, 
       product_id, maintenance_product_number,

+ 13 - 4
watero-rst-service/src/main/java/com/iamberry/rst/service/cm/mapper/complaintQuestionInfoMapper.xml

@@ -9,13 +9,15 @@
     <result column="question_is_qc_detect" property="questionIsQcDetect" jdbcType="BIT" />
     <result column="question_create_time" property="questionCreateTime" jdbcType="TIMESTAMP" />
     <result column="question_update_time" property="questionUpdateTime" jdbcType="TIMESTAMP" />
+    <result column="question_resolved_num" property="questionResolvedNum" jdbcType="INTEGER" />
+    <result column="question_not_solved_num" property="questionNotSolvedNum" jdbcType="INTEGER" />
   </resultMap>
   <resultMap id="ResultMapWithBLOBs" type="ComplaintQuestionInfo" extends="BaseResultMap" >
     <result column="question_profile" property="questionProfile" jdbcType="LONGVARCHAR" />
   </resultMap>
   <sql id="Base_Column_List" >
     question_id, small_class_id, question_name, question_state, question_is_qc_detect, 
-    question_create_time, question_update_time
+    question_create_time, question_update_time,question_resolved_num,question_not_solved_num
   </sql>
   <sql id="Blob_Column_List" >
     question_profile
@@ -32,7 +34,7 @@
   <select id="listComplaintQuestionInfo" resultMap="BaseResultMap" parameterType="ComplaintQuestionInfo" >
     select
     question_id, small_class_id, question_name, question_state, question_is_qc_detect,question_profile,
-    question_create_time, question_update_time
+    question_create_time, question_update_time,question_resolved_num,question_not_solved_num
     from tb_rst_complaint_question
     <where>
       <if test="smallClassId !=null">
@@ -50,11 +52,12 @@
   <insert id="insert" parameterType="ComplaintQuestionInfo" >
     insert into tb_rst_complaint_question (question_id, small_class_id, question_name, 
       question_state, question_is_qc_detect, question_create_time, 
-      question_update_time, question_profile
+      question_update_time, question_profile,question_resolved_num,question_not_solved_num
       )
     values (#{questionId,jdbcType=INTEGER}, #{smallClassId,jdbcType=INTEGER}, #{questionName,jdbcType=VARCHAR}, 
       #{questionState,jdbcType=BIT}, #{questionIsQcDetect,jdbcType=BIT}, #{questionCreateTime,jdbcType=TIMESTAMP}, 
-      #{questionUpdateTime,jdbcType=TIMESTAMP}, #{questionProfile,jdbcType=LONGVARCHAR}
+      #{questionUpdateTime,jdbcType=TIMESTAMP}, #{questionProfile,jdbcType=LONGVARCHAR}, #{questionResolvedNum,jdbcType=INTEGER}
+      , #{questionNotSolvedNum,jdbcType=INTEGER}
       )
   </insert>
   <update id="updateQuestionById" parameterType="ComplaintQuestionInfo" >
@@ -81,6 +84,12 @@
       <if test="questionProfile != null" >
         question_profile = #{questionProfile,jdbcType=LONGVARCHAR},
       </if>
+      <if test="questionResolvedNum != null" >
+        question_resolved_num = question_resolved_num+1,
+      </if>
+      <if test="questionNotSolvedNum != null" >
+        question_not_solved_num = question_not_solved_num+1,
+      </if>
     </set>
     where question_id = #{questionId,jdbcType=INTEGER}
   </update>

+ 1 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachinePartsServiceImpl.java

@@ -92,7 +92,7 @@ public class MachinePartsServiceImpl implements MachinePartsService {
                 PtsSupplier ptsSupplier = new PtsSupplier();
                 ptsSupplier.setSupplierNumber(heads.get(1));
                 ptsSupplier = machineSupplierMapper.getPtsSupplier(ptsSupplier);
-                ptsComponents.setSupplierId(ptsSupplier.getSupplierId() == null?null:ptsSupplier.getSupplierId());
+                ptsComponents.setSupplierId(ptsSupplier.getSupplierId());
                 ptsComponents.setComponentsName(heads.get(2));
                 ptsComponents.setComponentsStatus(heads.get(3).equals("正常使用" )? 1 : 0);
                 ptsComponents.setComponentsCost(Integer.valueOf(heads.get(4)) * 100);//元转换为分

+ 5 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/MachineServiceImpl.java

@@ -95,6 +95,11 @@ public class MachineServiceImpl implements MachineService {
     }
 
     @Override
+    public PtsMachine getMachineByBarCode(String machineBarcode) {
+        return machineMapper.getMachineByBarCode(machineBarcode);
+    }
+
+    @Override
     public Integer selectMonthCount(String yearMonth) {
         return machineMapper.selectMonthCount(yearMonth);
     }

+ 2 - 1
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/MachineMapper.java

@@ -42,7 +42,8 @@ public interface MachineMapper {
 
     //查询单个机器信息
     PtsMachine getMachine(Integer machineId);
-
+    //根据barcode查询单个机器信息
+    PtsMachine getMachineByBarCode(String machineBarcode);
     //查询每月机器台数 ,参数格式:2017-09
    Integer selectMonthCount(String yearMonth);
 

+ 26 - 0
watero-rst-service/src/main/java/com/iamberry/rst/service/pts/mapper/machineMapper.xml

@@ -410,4 +410,30 @@
             #{item.machineBatchId},#{item.machineBomId},#{item.machineIsRetreading},#{item.machineSoftwareVersion},#{item.machineLine})
         </foreach>
     </insert>
+
+    <select id="getMachineByBarCode" parameterType="String" resultType="PtsMachine">
+        select machine_id machineId,
+        machine_qrcode machineQrcode,
+        machine_barcode machineBarcode,
+        machine_sales_date machineSalesDate,
+        machine_sales_state machineSalesState,
+        machine_status machineStatus,
+        machine_produced_time machineProducedTime,
+        machine_sub_time machineSubTime,
+        machine_is_print machineIsPrint,
+        machine_compound_img machineCompoundImg,
+        machine_process_state machineProcessState,
+        machine_software_version machineSoftwareVersion,
+        machine_hardware_version machineHardwareVersion,
+        machine_create_time machineCreateTime,
+        machine_update_time machineUpdateTime,
+        machine_produce_type machineProduceType,
+        machine_produce_id machineProduceId,
+        machine_batch_id machineBatchId,
+        machine_bom_id  machineBomId,
+        machine_is_retreading  machineIsRetreading,
+        machine_line  machineLine,
+        machine_sales_company_id machineSalesCompanyId
+        from tb_rst_pts_machine WHERE  machine_barcode = #{machineBarcode} AND machine_sales_state = 1
+    </select>
 </mapper>

+ 26 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/AdminSignclosedController.java

@@ -298,5 +298,31 @@ public class AdminSignclosedController {
         mv.addObject("complaintSignclosedInfo",complaintSignclosedInfo);
         return mv;
     }
+    /**
+     * 转入品质
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("signclosed:update:signclosed")
+    @RequestMapping(value = "/into_complaint")
+    public ResponseJson intoComplaint(HttpServletRequest request,Integer signclosedId){
+        ResponseJson msg = new ResponseJson();
+        if(signclosedId == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Integer num = complaintSignclosedInfoService.intoComplaint(signclosedId);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
+
 }
 

+ 146 - 0
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintMaintenanceController.java

@@ -0,0 +1,146 @@
+package com.iamberry.rst.controllers.cm;
+
+import com.iamberry.rst.core.cm.*;
+import com.iamberry.rst.core.page.PageRequest;
+import com.iamberry.rst.core.page.PagedResult;
+import com.iamberry.rst.core.pts.PtsMachine;
+import com.iamberry.rst.faces.cm.ComplaintMaintenanceInfoService;
+import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
+import com.iamberry.rst.faces.cm.ComplaintSmallClassInfoService;
+import com.iamberry.rst.faces.cm.ComplaintTypeInfoService;
+import com.iamberry.rst.faces.pts.MachineService;
+import com.iamberry.rst.service.pts.mapper.MachineMapper;
+import com.iamberry.rst.utils.StitchAttrUtil;
+import com.iamberry.wechat.tools.ResponseJson;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+/**
+ * Created by wxm
+ * 问题
+ */
+@Controller
+@RequestMapping("/admin/maintenance")
+public class ComplaintMaintenanceController {
+
+    @Autowired
+    private ComplaintMaintenanceInfoService complaintMaintenanceInfoService;
+    @Autowired
+    private MachineService machineService;
+
+
+    /**
+     * 客诉 - 查询签收/仓储列表
+     * @param request
+     * @return
+     */
+    @RequiresPermissions("maintenance:select:maintenance")
+    @RequestMapping("/select_maintenance_list")
+    public ModelAndView selectmaintenanceList(HttpServletRequest request,
+                                         @RequestParam(value = "pageNO", defaultValue = "1", required = false) int pageNO,
+                                         @RequestParam(value = "pageTotal", required = false) Integer pageTotal,
+                                         @RequestParam(value = "pageSize", defaultValue = "5", required = false) int pageSize,
+                                         ComplaintMaintenanceInfo complaintMaintenanceInfo) {
+
+        ModelAndView mv = new ModelAndView("cm/signclosed/signclosed_list");
+        StringBuilder url = new StringBuilder("/admin/signclosed/select_signclosed_list?pageSize=" + pageSize);
+        // 封装请求数据
+        PageRequest<ComplaintMaintenanceInfo> pageRequest = new PageRequest<>(complaintMaintenanceInfo, pageNO, pageSize, pageTotal == null);
+        PagedResult<ComplaintMaintenanceInfo> result = complaintMaintenanceInfoService.listMaintenance(pageRequest);
+        long total = 0;
+        if (pageTotal == null) {
+            total = result.getPages();
+        } else {
+            total = pageTotal;
+            result.setPages(total);
+        }
+        StitchAttrUtil.setModelAndView(complaintMaintenanceInfo, mv, "/admin/maintenance/select_maintenance_list", result);
+        return mv;
+    }
+
+    /**
+     * 修改维修记录
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping(value = "/update_maintenance")
+    public ResponseJson updateMaintenance(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo){
+        ResponseJson msg = new ResponseJson();
+        if(maintenanceInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Integer num = complaintMaintenanceInfoService.updateMaintenanceById(maintenanceInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
+    /**
+     * 增加维修记录
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("maintenance:add:maintenance")
+    @RequestMapping(value = "/add_maintenance")
+    public ResponseJson addMaintenance(HttpServletRequest request,ComplaintMaintenanceInfo maintenanceInfo){
+        ResponseJson msg = new ResponseJson();
+        if(maintenanceInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Integer num = complaintMaintenanceInfoService.insert(maintenanceInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
+
+    /**
+     *
+     *根据机器编号搜索机器出库记录
+     * @return
+     */
+    @ResponseBody
+    @RequiresPermissions("maintenance:update:maintenance")
+    @RequestMapping(value = "/select_outbound")
+    public ResponseJson selectOutbound(HttpServletRequest request,String machineNum){
+        ResponseJson msg = new ResponseJson();
+        if(machineNum == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        PtsMachine ptsMachine = machineService.getMachineByBarCode(machineNum);
+        if (ptsMachine == null) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+            msg.addResponseKeyValue("ptsMachine",ptsMachine);
+        }
+        return msg;
+    }
+}

+ 49 - 1
watero-rst-web/src/main/java/com/iamberry/rst/controllers/cm/ComplaintQuestionInfoController.java

@@ -7,6 +7,7 @@ import com.iamberry.rst.faces.cm.ComplaintQuestionInfoService;
 import com.iamberry.rst.faces.cm.ComplaintSmallClassInfoService;
 import com.iamberry.rst.faces.cm.ComplaintTypeInfoService;
 import com.iamberry.wechat.tools.ResponseJson;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -97,6 +98,53 @@ public class ComplaintQuestionInfoController {
     }
 
 
-
+    /**
+     * 修改是否已解决总数
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/update_question_num")
+    public ResponseJson updateQuestionNum(HttpServletRequest request, ComplaintQuestionInfo complaintQuestionInfo){
+        ResponseJson msg = new ResponseJson();
+        if(complaintQuestionInfo == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        Integer num = complaintQuestionInfoService.updateQuestionById(complaintQuestionInfo);
+        if (num < 1) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
+    /**
+     * 查询客诉问题
+     *
+     * @return
+     */
+    @ResponseBody
+    @RequestMapping(value = "/get_question")
+    public ResponseJson getQuestion(HttpServletRequest request, Integer questionId){
+        ResponseJson msg = new ResponseJson();
+        if(questionId == null){
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+            return msg;
+        }
+        ComplaintQuestionInfo complaintQuestionInfo = complaintQuestionInfoService.getQuestionById(questionId);
+        if (complaintQuestionInfo  == null) {
+            msg.setResultCode(500);
+            msg.setReturnCode(500);
+        } else {
+            msg.setResultCode(200);
+            msg.setReturnCode(200);
+        }
+        return msg;
+    }
 
 }

+ 7 - 7
watero-rst-web/src/main/java/com/iamberry/rst/controllers/pts/AdminMachinePartsController.java

@@ -138,12 +138,12 @@ public class AdminMachinePartsController {
      * **/
     @RequestMapping("/excelAdd")
     @ResponseBody
-    public boolean excelAdd(@RequestParam("sourceFile") MultipartFile sourceFile, HttpServletRequest request, HttpServletResponse response)throws IOException  {
+    public boolean excelAdd(@RequestParam("sourceFile") String sourceFile, HttpServletRequest request, HttpServletResponse response)throws IOException  {
         //判断文件是否为空
         if (sourceFile==null) {
             return false;
         }
-        //获取文件名
+        /*//获取文件名
         String name=sourceFile.getOriginalFilename();
         long size =sourceFile.getSize();
         if (name==null ||("").equals(name) && size==0) {
@@ -163,12 +163,12 @@ public class AdminMachinePartsController {
         } catch (Exception e) {
             e.printStackTrace();
         }
-
+*/
         // 获取Workbook
-        InputStream inputStream = new BufferedInputStream(new FileInputStream(file1));
+        InputStream inputStream = new BufferedInputStream(new FileInputStream(request.getServletContext().getRealPath(sourceFile)));
         Workbook wb  = null;
 
-        if (name.endsWith("xls")) {
+        if (sourceFile.endsWith("xls")) {
             wb = new HSSFWorkbook(inputStream);
         } else {
             wb = new XSSFWorkbook(inputStream);
@@ -190,7 +190,7 @@ public class AdminMachinePartsController {
      * @return
      */
     @RequestMapping("/generation_excel")
-    public ModelAndView generationExcel(){
+    public ModelAndView generationExcel(HttpServletRequest request){
         // 准备model
         Map<String, Object> model = new HashMap<String, Object>();
         model.put("fileName", "零件列表");	// 下载文件名称
@@ -218,7 +218,7 @@ public class AdminMachinePartsController {
             row.add(info.getComponentsNo() == null ? null:info.getComponentsNo());
             row.add(info.getSupplierName() == null ? null:info.getSupplierName());
             row.add(info.getComponentsName() == null ? null:info.getComponentsName());
-            row.add(info.getComponentsImg() == null ? null:info.getComponentsImg());
+            row.add(info.getComponentsImg() == null ? null:request.getServerName()+info.getComponentsImg());
             row.add(info.getComponentsStatus() == 0 ? "停止使用":"正常使用");
             row.add(info.getComponentsCost()/100);
             row.add(info.getComponentsWeight());

+ 38 - 4
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/signclosed_list.ftl

@@ -198,10 +198,12 @@
                     <td class="text-c" width="100">${signclosed.signclosedDesc!}</td>
                     <!-- 遍历操作 -->
                     <td class="td-manage text-c">
-                        <a style="text-decoration:none" href="javascript:;" title="签收"
-                           onclick="update_info('${path}/admin/signclosed/to_complete_signclosed?signclosedId=${signclosedId!''}');">
-                            <i class="Hui-iconfont">&#xe6df;</i>
-                        </a>
+                        <#if signclosed.signclosedState == 2>
+                            <a style="text-decoration:none" href="javascript:;" title="签收"
+                               onclick="update_info('${path}/admin/signclosed/to_complete_signclosed?signclosedId=${signclosedId!''}');">
+                                <i class="Hui-iconfont">&#xe6df;</i>
+                            </a>
+                        </#if>
                         <a style="text-decoration:none" href="javascript:;" title="修改备注"
                            onclick="add_remark('修改备注','${path}/admin/signclosed/to_update_remark?signclosedId=${signclosedId!''}','570','450');">
                             <i class="Hui-iconfont">&#xe692;</i>
@@ -210,6 +212,13 @@
                            onclick="add_remark('修改寄件人信息','${path}/admin/signclosed/to_update_sender?signclosedId=${signclosedId!''}','570','450');">
                             <i class="Hui-iconfont">&#xe60c;</i>
                         </a>
+                        <#if signclosed.signclosedIsInto == 2>
+                            <a style="text-decoration:none" href="javascript:;" title="转入品检"
+                               onclick="into_complaint('${signclosedId!''}');">
+                                <i class="Hui-iconfont">&#xe644;</i>
+                            </a>
+                        </#if>
+
                     </td>
                 </tr>
                 </#list>
@@ -236,6 +245,31 @@
     function update_info(url){
         window.location.href = url;
     }
+    /*转入品检*/
+    function into_complaint(signclosedId){
+        layer.alert('确定转入到品检部门吗?', function () {
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: "${path}/admin/signclosed/into_complaint",
+                data:{"signclosedId":signclosedId},
+                async: false,
+                success: function(data){
+                    if (data.returnCode == 200) {
+                        layer.msg('转入成功',{icon: 1,time:1000},function () {
+                            location.replace(location.href);
+                        });
+                    } else {
+                        layer.msg('转入失败',{icon: 5,time:1000});
+                    }
+                },
+                error: function(XmlHttpRequest, textStatus, errorThrown){
+                    layer.msg('转入错误',{icon: 5,time:1000});
+                }
+            });
+        });
+    }
+
 </script>
 </body>
 </html>

+ 10 - 11
watero-rst-web/src/main/webapp/WEB-INF/views/cm/signclosed/update_sender.ftl

@@ -89,7 +89,7 @@
         <div class="row cl" style="position: relative;">
             <label class="form-label col-3 col-sm-3 huanhang"><span class="c-red">*</span>物流信息:</label>
             <div class="formControls col-3 col-sm-3 skin-minimal huanhang">
-                    <span class="select-box">
+                    <span class="select-box" style="width: 150px;">
                     <select name="signclosedLogistics" class="select">
                         <option value="">请选择物流公司</option>
                         <option value="sto">申通快递</option>
@@ -125,15 +125,6 @@
 
 
     function  update() {
-        var signclosedLogisticsNumber = $("#signclosedLogisticsNumber").val();
-        if( signclosedLogisticsNumber == null || signclosedLogisticsNumber == "" ){
-            layer.msg('物流单号不能为空',{icon: 5,time:1000});
-            return;
-        }
-        if( signclosedLogisticsNumber.length > 300 ){
-            layer.msg('物流单号长度不得大于20个字符',{icon: 5,time:1000});
-            return;
-        }
         var signclosedSendName = $("#signclosedSendName").val();
         if( signclosedSendName == null || signclosedSendName == "" ){
             layer.msg('寄件人姓名不能为空',{icon: 5,time:1000});
@@ -157,7 +148,15 @@
             layer.msg('寄件人电话格式不正确',{icon: 5,time:1000});
             return;
         }
-
+        var signclosedLogisticsNumber = $("#signclosedLogisticsNumber").val();
+        if( signclosedLogisticsNumber == null || signclosedLogisticsNumber == "" ){
+            layer.msg('物流单号不能为空',{icon: 5,time:1000});
+            return;
+        }
+        if( signclosedLogisticsNumber.length > 300 ){
+            layer.msg('物流单号长度不得大于20个字符',{icon: 5,time:1000});
+            return;
+        }
         $.ajax({
             cache: true,
             type: "POST",

+ 60 - 8
watero-rst-web/src/main/webapp/WEB-INF/views/pts/machinePtras/parts_list.ftl

@@ -56,12 +56,14 @@
             <input type="text" class="my-input"  style="width:80px" value="${componentsName!}" placeholder="零件名称" id="componentsName" name="componentsName">
             <button type="submit" class="btn" style="background: #32a3d8;color: #fff;-webkit-transform:translateY(-5%);" id="" name=""><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
         </form>
-        <form id="sourcefile" name="sourcefile" action=""  method="post" enctype="multipart/form-data" style="width: 42%;display: inline-block;">
+        <#--<form id="sourcefile" name="sourcefile" action=""  method="post" enctype="multipart/form-data" style="width: 42%;display: inline-block;">
             <input class="my-btn-search" data-loading-text="请勿重复提交" type="button" value="上传EXCEL" onClick="upPolicy()">
             <input style="width: 125px;" id="source_file" name="sourceFile" type="file" value="" />
             <button type="button" style="cursor:pointer;" class="my-btn-search" onclick="toExcel();">导出Excel</button>
             <button type="button" style="cursor:pointer;" class="my-btn-search" onclick="downloadExcel();">下载模板</button>
-        </form>
+        </form>-->
+        <button onClick="upFiles();" class="btn radius" style="background: #32a3d8;color: #fff;" type="button"><i class="Hui-iconfont">&#xe632;</i> 上传Excel</button>
+        <button type="button" style="cursor:pointer;" class="my-btn-search" onclick="downloadExcel();">下载模板</button>
     </div>
 
     <div class="mt-20">
@@ -125,14 +127,64 @@
 <tfoot>
 <#include "/base/page_util.ftl">
 </tfoot>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.config.js"></script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/ueditor.all.min.js"> </script>
+<script type="text/javascript" src="${path}/common/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
+<script type="text/plain" id="upload_ue"></script>
 <script type="text/javascript">
+    var _editor;
+    $(function() {
+        //重新实例化一个编辑器,防止在上面的editor编辑器中显示上传的图片或者文件
+        _editor = UE.getEditor('upload_ue',{
+            initialFrameWidth : 375,
+            initialFrameHeight: 600
+        });
+        _editor.ready(function () {
+            _editor.setDisabled("attachment");//设置编辑器不可用
+            _editor.hide();//隐藏编辑器,因为不会用到这个编辑器实例,所以要隐藏
+            //侦听图片上传
+            _editor.addListener('beforeInsertImage', function (t, arg) {
+                console.log(arg[0].src);
+                $("#picture").attr("value", arg[0].src);//将地址赋值给相应的input,只去第一张图片的路径
+                $("#preview").attr("src", arg[0].src);  //图片预览
+            });
+            //侦听文件上传,取上传文件列表中第一个上传的文件的路径
+            _editor.addListener('afterUpfile', function (t, arg) {
+                console.log(arg[0].url);
+                /*window.location.href=root_path + '/admin/machineParts/excelAdd?sourceFile='+arg[0].url;*/
+                $.ajax({
+                    cache: true,
+                    type: "POST",
+                    data: {"sourceFile":arg[0].url},
+                    contentType: false,
+                    processData: false,
+                    url: "${path}/admin/machineParts/excelAdd",
+                    async: false,
+                    success: function(data){
+                        if (data) {
+                            layer.msg('添加成功!', {icon: 1, time: 2000},function () {
+                                window.location.href = '${path}/admin/machineParts/_parts_list'
+                            });
 
-
-    /*管理员-编辑*/
-    function parts_edit(title,url,id,w,h){
-        layer_show(title,url,w,h);
+                        }else{
+                            layer.msg('添加失败!', {icon: 2, time: 2000});
+                        }
+                    },
+                    error: function(XmlHttpRequest, textStatus, errorThrown){
+                        layer.msg('添加失败!', {icon: 2, time: 2000});
+                    }
+                });
+                $("#source_file").attr("value", _editor.options.filePath + arg[0].url);
+            });
+        });
+    });
+    //弹出文件上传的对话框
+    function upFiles() {
+            var myFiles = _editor.getDialog("attachment");
+            myFiles.open();
     }
 
+
     /* 修改二级菜单状态 */
     function update_FAQState(detaId) {
         layer.confirm('确认要停用吗?',function(index){
@@ -153,7 +205,7 @@
 
 </script>
 <script type="text/javascript">
-    function upPolicy() {
+    /*function upPolicy() {
         if($('#source_file').val().length > 0){
             var formData = new FormData($( "#sourcefile" )[0]);
             $.ajax({
@@ -182,7 +234,7 @@
          layer.msg('请先上传文件!', {icon: 2, time: 2000});
         }
 
-    }
+    }*/
     /**
      * 跳转到添加零件页面
      */