Browse Source

日志处理

guq 7 years ago
parent
commit
0ca614e17c
18 changed files with 1837 additions and 24 deletions
  1. 14 2
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java
  2. 40 0
      applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MessageLogService.java
  3. 70 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Messagelog.java
  4. 911 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/MessagelogExample.java
  5. 109 0
      applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java
  6. 58 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java
  7. 31 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MessagelogMapper.java
  8. 24 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MessageLogService.java
  9. 84 0
      applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MessageLogServiceImpl.java
  10. 1 0
      applications/commons/commons-server/src/main/resources/application.yml
  11. 0 0
      applications/commons/commons-server/src/main/resources/i18n/messages.properties
  12. 117 0
      applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties
  13. 307 0
      applications/commons/commons-server/src/main/resources/mapper/MessagelogMapper.xml
  14. 5 5
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java
  15. 2 0
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java
  16. 3 2
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java
  17. 58 15
      applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java
  18. 3 0
      applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

+ 14 - 2
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MaxnumberService.java

@@ -4,7 +4,11 @@ import com.usoftchina.saas.base.Result;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestParam;
-
+/**
+* @Description: 编号接口
+* @Author: guq
+* @Date: 2018/10/20
+*/
 @FeignClient("commons-server")
 public interface MaxnumberService {
     /**
@@ -17,5 +21,13 @@ public interface MaxnumberService {
     @PostMapping("/number/pushMaxnubmer")
     public String pushMaxnubmer(@RequestParam("count") Integer count,@RequestParam("code") String code,
                                 @RequestParam("caller") String caller);
-
+    /**
+    * @Description 获取单号
+    * @Param: [caller, update]
+    * @return: com.usoftchina.saas.base.Result
+    * @Author: guq
+    * @Date: 2018/10/22
+    */
+    @PostMapping("/getMaxnumber")
+    public Result getMaxnumber(@RequestParam("caller") String caller, @RequestParam("update") boolean update);
 }

+ 40 - 0
applications/commons/commons-api/src/main/java/com/usoftchina/saas/commons/api/MessageLogService.java

@@ -0,0 +1,40 @@
+package com.usoftchina.saas.commons.api;
+
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+* @Description: 日志接口
+* @Author: guq
+* @Date: 2018/10/20
+*/
+@FeignClient("commons-server")
+public interface MessageLogService {
+
+    @RequestMapping("/save")
+    public void save(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/update")
+    public void update(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/delete")
+    public void delete(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/deleteDetail")
+    public void deleteDetail(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/audit")
+    public void audit(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/unAudit")
+    public void unAudit(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/close")
+    public void close(@RequestBody DocBaseDTO baseDTO);
+
+    @RequestMapping("/open")
+    public void open(@RequestBody DocBaseDTO baseDTO);
+}

+ 70 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Messagelog.java

@@ -0,0 +1,70 @@
+package com.usoftchina.saas.commons.po;
+
+import com.usoftchina.saas.base.entity.CommonBaseEntity;
+
+import java.util.Date;
+
+public class Messagelog extends CommonBaseEntity{
+
+    private String ml_code;
+
+    private String ml_content;
+
+    private String ml_result;
+
+    private String ml_caller;
+
+    private String ml_man;
+
+    public Long getMl_keyvalue() {
+        return ml_keyvalue;
+    }
+
+    public void setMl_keyvalue(Long ml_keyvalue) {
+        this.ml_keyvalue = ml_keyvalue;
+    }
+
+    private Long ml_keyvalue;
+
+
+    public String getMl_code() {
+        return ml_code;
+    }
+
+    public void setMl_code(String ml_code) {
+        this.ml_code = ml_code == null ? null : ml_code.trim();
+    }
+
+    public String getMl_content() {
+        return ml_content;
+    }
+
+    public void setMl_content(String ml_content) {
+        this.ml_content = ml_content == null ? null : ml_content.trim();
+    }
+
+    public String getMl_result() {
+        return ml_result;
+    }
+
+    public void setMl_result(String ml_result) {
+        this.ml_result = ml_result == null ? null : ml_result.trim();
+    }
+
+    public String getMl_caller() {
+        return ml_caller;
+    }
+
+    public void setMl_caller(String ml_caller) {
+        this.ml_caller = ml_caller == null ? null : ml_caller.trim();
+    }
+
+    public String getMl_man() {
+        return ml_man;
+    }
+
+    public void setMl_man(String ml_man) {
+        this.ml_man = ml_man == null ? null : ml_man.trim();
+    }
+
+}

+ 911 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/MessagelogExample.java

@@ -0,0 +1,911 @@
+package com.usoftchina.saas.commons.po;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class MessagelogExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    public MessagelogExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andMl_idIsNull() {
+            addCriterion("ml_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idIsNotNull() {
+            addCriterion("ml_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idEqualTo(Integer value) {
+            addCriterion("ml_id =", value, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idNotEqualTo(Integer value) {
+            addCriterion("ml_id <>", value, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idGreaterThan(Integer value) {
+            addCriterion("ml_id >", value, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idGreaterThanOrEqualTo(Integer value) {
+            addCriterion("ml_id >=", value, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idLessThan(Integer value) {
+            addCriterion("ml_id <", value, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idLessThanOrEqualTo(Integer value) {
+            addCriterion("ml_id <=", value, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idIn(List<Integer> values) {
+            addCriterion("ml_id in", values, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idNotIn(List<Integer> values) {
+            addCriterion("ml_id not in", values, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idBetween(Integer value1, Integer value2) {
+            addCriterion("ml_id between", value1, value2, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_idNotBetween(Integer value1, Integer value2) {
+            addCriterion("ml_id not between", value1, value2, "ml_id");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeIsNull() {
+            addCriterion("ml_code is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeIsNotNull() {
+            addCriterion("ml_code is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeEqualTo(String value) {
+            addCriterion("ml_code =", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeNotEqualTo(String value) {
+            addCriterion("ml_code <>", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeGreaterThan(String value) {
+            addCriterion("ml_code >", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeGreaterThanOrEqualTo(String value) {
+            addCriterion("ml_code >=", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeLessThan(String value) {
+            addCriterion("ml_code <", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeLessThanOrEqualTo(String value) {
+            addCriterion("ml_code <=", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeLike(String value) {
+            addCriterion("ml_code like", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeNotLike(String value) {
+            addCriterion("ml_code not like", value, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeIn(List<String> values) {
+            addCriterion("ml_code in", values, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeNotIn(List<String> values) {
+            addCriterion("ml_code not in", values, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeBetween(String value1, String value2) {
+            addCriterion("ml_code between", value1, value2, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_codeNotBetween(String value1, String value2) {
+            addCriterion("ml_code not between", value1, value2, "ml_code");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentIsNull() {
+            addCriterion("ml_content is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentIsNotNull() {
+            addCriterion("ml_content is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentEqualTo(String value) {
+            addCriterion("ml_content =", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentNotEqualTo(String value) {
+            addCriterion("ml_content <>", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentGreaterThan(String value) {
+            addCriterion("ml_content >", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentGreaterThanOrEqualTo(String value) {
+            addCriterion("ml_content >=", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentLessThan(String value) {
+            addCriterion("ml_content <", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentLessThanOrEqualTo(String value) {
+            addCriterion("ml_content <=", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentLike(String value) {
+            addCriterion("ml_content like", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentNotLike(String value) {
+            addCriterion("ml_content not like", value, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentIn(List<String> values) {
+            addCriterion("ml_content in", values, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentNotIn(List<String> values) {
+            addCriterion("ml_content not in", values, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentBetween(String value1, String value2) {
+            addCriterion("ml_content between", value1, value2, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_contentNotBetween(String value1, String value2) {
+            addCriterion("ml_content not between", value1, value2, "ml_content");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultIsNull() {
+            addCriterion("ml_result is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultIsNotNull() {
+            addCriterion("ml_result is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultEqualTo(String value) {
+            addCriterion("ml_result =", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultNotEqualTo(String value) {
+            addCriterion("ml_result <>", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultGreaterThan(String value) {
+            addCriterion("ml_result >", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultGreaterThanOrEqualTo(String value) {
+            addCriterion("ml_result >=", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultLessThan(String value) {
+            addCriterion("ml_result <", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultLessThanOrEqualTo(String value) {
+            addCriterion("ml_result <=", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultLike(String value) {
+            addCriterion("ml_result like", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultNotLike(String value) {
+            addCriterion("ml_result not like", value, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultIn(List<String> values) {
+            addCriterion("ml_result in", values, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultNotIn(List<String> values) {
+            addCriterion("ml_result not in", values, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultBetween(String value1, String value2) {
+            addCriterion("ml_result between", value1, value2, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_resultNotBetween(String value1, String value2) {
+            addCriterion("ml_result not between", value1, value2, "ml_result");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerIsNull() {
+            addCriterion("ml_caller is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerIsNotNull() {
+            addCriterion("ml_caller is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerEqualTo(String value) {
+            addCriterion("ml_caller =", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerNotEqualTo(String value) {
+            addCriterion("ml_caller <>", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerGreaterThan(String value) {
+            addCriterion("ml_caller >", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerGreaterThanOrEqualTo(String value) {
+            addCriterion("ml_caller >=", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerLessThan(String value) {
+            addCriterion("ml_caller <", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerLessThanOrEqualTo(String value) {
+            addCriterion("ml_caller <=", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerLike(String value) {
+            addCriterion("ml_caller like", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerNotLike(String value) {
+            addCriterion("ml_caller not like", value, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerIn(List<String> values) {
+            addCriterion("ml_caller in", values, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerNotIn(List<String> values) {
+            addCriterion("ml_caller not in", values, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerBetween(String value1, String value2) {
+            addCriterion("ml_caller between", value1, value2, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_callerNotBetween(String value1, String value2) {
+            addCriterion("ml_caller not between", value1, value2, "ml_caller");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manIsNull() {
+            addCriterion("ml_man is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manIsNotNull() {
+            addCriterion("ml_man is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manEqualTo(String value) {
+            addCriterion("ml_man =", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manNotEqualTo(String value) {
+            addCriterion("ml_man <>", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manGreaterThan(String value) {
+            addCriterion("ml_man >", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manGreaterThanOrEqualTo(String value) {
+            addCriterion("ml_man >=", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manLessThan(String value) {
+            addCriterion("ml_man <", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manLessThanOrEqualTo(String value) {
+            addCriterion("ml_man <=", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manLike(String value) {
+            addCriterion("ml_man like", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manNotLike(String value) {
+            addCriterion("ml_man not like", value, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manIn(List<String> values) {
+            addCriterion("ml_man in", values, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manNotIn(List<String> values) {
+            addCriterion("ml_man not in", values, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manBetween(String value1, String value2) {
+            addCriterion("ml_man between", value1, value2, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andMl_manNotBetween(String value1, String value2) {
+            addCriterion("ml_man not between", value1, value2, "ml_man");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIsNull() {
+            addCriterion("companyId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIsNotNull() {
+            addCriterion("companyId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdEqualTo(Integer value) {
+            addCriterion("companyId =", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotEqualTo(Integer value) {
+            addCriterion("companyId <>", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdGreaterThan(Integer value) {
+            addCriterion("companyId >", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("companyId >=", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdLessThan(Integer value) {
+            addCriterion("companyId <", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdLessThanOrEqualTo(Integer value) {
+            addCriterion("companyId <=", value, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdIn(List<Integer> values) {
+            addCriterion("companyId in", values, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotIn(List<Integer> values) {
+            addCriterion("companyId not in", values, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdBetween(Integer value1, Integer value2) {
+            addCriterion("companyId between", value1, value2, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCompanyIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("companyId not between", value1, value2, "companyId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("createTime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("createTime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("createTime =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("createTime <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("createTime >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("createTime >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("createTime <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("createTime <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("createTime in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("createTime not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("createTime between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("createTime not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIsNull() {
+            addCriterion("creatorId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIsNotNull() {
+            addCriterion("creatorId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdEqualTo(Integer value) {
+            addCriterion("creatorId =", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotEqualTo(Integer value) {
+            addCriterion("creatorId <>", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdGreaterThan(Integer value) {
+            addCriterion("creatorId >", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("creatorId >=", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdLessThan(Integer value) {
+            addCriterion("creatorId <", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdLessThanOrEqualTo(Integer value) {
+            addCriterion("creatorId <=", value, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdIn(List<Integer> values) {
+            addCriterion("creatorId in", values, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotIn(List<Integer> values) {
+            addCriterion("creatorId not in", values, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdBetween(Integer value1, Integer value2) {
+            addCriterion("creatorId between", value1, value2, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreatorIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("creatorId not between", value1, value2, "creatorId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("updateTime is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("updateTime is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("updateTime =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("updateTime <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("updateTime >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("updateTime >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("updateTime <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("updateTime <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("updateTime in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("updateTime not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("updateTime between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("updateTime not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIsNull() {
+            addCriterion("updaterId is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIsNotNull() {
+            addCriterion("updaterId is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdEqualTo(Integer value) {
+            addCriterion("updaterId =", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotEqualTo(Integer value) {
+            addCriterion("updaterId <>", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdGreaterThan(Integer value) {
+            addCriterion("updaterId >", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdGreaterThanOrEqualTo(Integer value) {
+            addCriterion("updaterId >=", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdLessThan(Integer value) {
+            addCriterion("updaterId <", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdLessThanOrEqualTo(Integer value) {
+            addCriterion("updaterId <=", value, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdIn(List<Integer> values) {
+            addCriterion("updaterId in", values, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotIn(List<Integer> values) {
+            addCriterion("updaterId not in", values, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdBetween(Integer value1, Integer value2) {
+            addCriterion("updaterId between", value1, value2, "updaterId");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdaterIdNotBetween(Integer value1, Integer value2) {
+            addCriterion("updaterId not between", value1, value2, "updaterId");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 109 - 0
applications/commons/commons-dto/src/main/java/com/usoftchina/saas/commons/po/Operation.java

@@ -0,0 +1,109 @@
+package com.usoftchina.saas.commons.po;
+
+public enum Operation {
+
+    /**
+     * 新增
+     */
+    SAVE("msg.save", "msg.saveSuccess"),
+    /**
+     * 修改
+     */
+    UPDATE("msg.update", "msg.updateSuccess"),
+    /**
+     * 审核
+     */
+    AUDIT("msg.audit", "msg.auditSuccess"),
+    /**
+     * 反审核
+     */
+    RESAUDIT("msg.resAudit", "msg.resAuditSuccess"),
+    /**
+     * 记账
+     */
+    POST("msg.post", "msg.postSuccess"),
+    /**
+     * 反记账
+     */
+    RESPOST("msg.resPost", "msg.resPostSuccess"),
+    /**
+     * 打印
+     */
+    PRINT("msg.print", "msg.printSuccess"),
+    /**
+     * 关闭
+     */
+    CLOSE("msg.close", "msg.closeSuccess"),
+    /**
+     * 删除
+     */
+    DELETE("msg.delete", "msg.deleteSuccess"),
+    /**
+     * 删除明细
+     */
+    DELETEDETAIL("msg.deleteDetail", "msg.deleteDetailSuccess"),
+    /**
+     * 反结案=>已审核
+     */
+    OPEN("msg.resClose", "msg.resCloseSuccess"),
+    /**
+     * 禁用操作
+     */
+    BANNED("msg.banned", "msg.bannedSuccess");
+
+    private final String title;
+    private final String result;
+
+    private Operation(String title, String result) {
+        this.title = title;
+        this.result = result;
+    }
+
+    /**
+     * 操作描述
+     *
+     * @param
+     * @return
+     */
+    public String getTitle() {
+        return this.title;
+    }
+
+    /**
+     * 操作描述
+     *
+     * @param
+     * @return
+     */
+    public String getResult() {
+        return this.result;
+    }
+
+  /*  *//**
+     * 操作结果
+     *
+     * @param
+     * @return
+     *//*
+    public String getResult() {
+        return getResult(null);
+    }
+
+    *//**
+     * 操作结果
+     *
+     * @param language
+     * @return
+     *//*
+    public String getResult(String language) {
+        return getLocalMessage(this.result, language);
+    }
+
+
+    private String getLocalMessage(String msg, String language) {
+
+        return null;
+    }*/
+
+
+}

+ 58 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/controller/MessageLogController.java

@@ -0,0 +1,58 @@
+package com.usoftchina.saas.commons.controller;
+
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.service.MessageLogService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+/**
+ * @author: guq
+ * @create: 2018-10-20 11:46
+ **/
+@RequestMapping("/messagelog")
+public class MessageLogController {
+
+    @Autowired
+    private MessageLogService messageLogService;
+
+    @RequestMapping("/save")
+    public void save(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.save(baseDTO);
+    }
+
+    @RequestMapping("/update")
+    public void update(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.update(baseDTO);
+    }
+
+    @RequestMapping("/delete")
+    public void delete(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.delete(baseDTO);
+    }
+
+    @RequestMapping("/deleteDetail")
+    public void deleteDetail(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.deleteDetail(baseDTO);
+    }
+
+    @RequestMapping("/audit")
+    public void audit(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.audit(baseDTO);
+    }
+
+    @RequestMapping("/unAudit")
+    public void unAudit(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.unAudit(baseDTO);
+    }
+
+    @RequestMapping("/close")
+    public void close(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.close(baseDTO);
+    }
+
+    @RequestMapping("/open")
+    public void open(@RequestBody DocBaseDTO baseDTO) {
+        messageLogService.open(baseDTO);
+    }
+}

+ 31 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/mapper/MessagelogMapper.java

@@ -0,0 +1,31 @@
+package com.usoftchina.saas.commons.mapper;
+
+import com.usoftchina.saas.base.mapper.CommonBaseMapper;
+import com.usoftchina.saas.commons.po.Messagelog;
+import com.usoftchina.saas.commons.po.MessagelogExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface MessagelogMapper extends CommonBaseMapper<Messagelog>{
+    int countByExample(MessagelogExample example);
+
+    int deleteByExample(MessagelogExample example);
+
+    int deleteByPrimaryKey(Integer ml_id);
+
+    int insert(Messagelog record);
+
+    int insertSelective(Messagelog record);
+
+    List<Messagelog> selectByExample(MessagelogExample example);
+
+    Messagelog selectByPrimaryKey(Integer ml_id);
+
+    int updateByExampleSelective(@Param("record") Messagelog record, @Param("example") MessagelogExample example);
+
+    int updateByExample(@Param("record") Messagelog record, @Param("example") MessagelogExample example);
+
+    int updateByPrimaryKeySelective(Messagelog record);
+
+    int updateByPrimaryKey(Messagelog record);
+}

+ 24 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/MessageLogService.java

@@ -0,0 +1,24 @@
+package com.usoftchina.saas.commons.service;
+
+import com.usoftchina.saas.base.service.CommonBaseService;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.mapper.MessagelogMapper;
+import com.usoftchina.saas.commons.po.Messagelog;
+
+public interface MessageLogService extends CommonBaseService<MessagelogMapper, Messagelog>{
+    void save(DocBaseDTO baseDTO);
+
+    void update(DocBaseDTO baseDTO);
+
+    void delete(DocBaseDTO baseDTO);
+
+    void deleteDetail(DocBaseDTO baseDTO);
+
+    void audit(DocBaseDTO baseDTO);
+
+    void unAudit(DocBaseDTO baseDTO);
+
+    void close(DocBaseDTO baseDTO);
+
+    void open(DocBaseDTO baseDTO);
+}

+ 84 - 0
applications/commons/commons-server/src/main/java/com/usoftchina/saas/commons/service/impl/MessageLogServiceImpl.java

@@ -0,0 +1,84 @@
+package com.usoftchina.saas.commons.service.impl;
+
+import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
+import com.usoftchina.saas.commons.mapper.MessagelogMapper;
+import com.usoftchina.saas.commons.po.Messagelog;
+import com.usoftchina.saas.commons.po.Operation;
+import com.usoftchina.saas.commons.service.MessageLogService;
+import com.usoftchina.saas.context.BaseContextHolder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.context.MessageSource;
+import org.springframework.stereotype.Service;
+
+import java.util.Date;
+import java.util.Locale;
+
+/**
+ * @author: guq
+ * @create: 2018-10-20 13:44
+ **/
+@Service
+public class MessageLogServiceImpl extends CommonBaseServiceImpl<MessagelogMapper, Messagelog> implements MessageLogService {
+
+    @Autowired
+    private MessageSource messageSource;
+
+    @Override
+    public void save(DocBaseDTO baseDTO) {
+        log(Operation.SAVE, baseDTO);
+    }
+
+    @Override
+    public void update(DocBaseDTO baseDTO) {
+        log(Operation.UPDATE, baseDTO);
+    }
+
+    @Override
+    public void delete(DocBaseDTO baseDTO) {
+        log(Operation.DELETE, baseDTO);
+    }
+
+    @Override
+    public void deleteDetail(DocBaseDTO baseDTO) {
+        log(Operation.DELETEDETAIL, baseDTO);
+    }
+
+    @Override
+    public void audit(DocBaseDTO baseDTO) {
+        log(Operation.AUDIT, baseDTO);
+    }
+
+    @Override
+    public void unAudit(DocBaseDTO baseDTO) {
+        log(Operation.RESAUDIT, baseDTO);
+    }
+
+    @Override
+    public void close(DocBaseDTO baseDTO) {
+        log(Operation.CLOSE, baseDTO);
+    }
+
+    @Override
+    public void open(DocBaseDTO baseDTO) {
+        log(Operation.OPEN, baseDTO);
+    }
+
+    private void log(Operation operation, DocBaseDTO baseDTO) {
+        String language = "zh_CN";
+        Messagelog msg = new Messagelog();
+        msg.setMl_caller(baseDTO.getName());
+        msg.setMl_content(getLocalMessage(operation.getTitle(), language));
+        msg.setMl_result(getLocalMessage(operation.getResult(), language));
+        msg.setMl_code(baseDTO.getCode());
+        msg.setCompanyId(BaseContextHolder.getCompanyId());
+        msg.setCreateTime(new Date());
+        msg.setCreatorId(BaseContextHolder.getUserId());
+        msg.setMl_keyvalue(baseDTO.getId());
+        getMapper().insert(msg);
+    }
+
+    private String getLocalMessage(String msg, String language) {
+       return messageSource.getMessage(msg, null, Locale.CHINA);
+    }
+}

+ 1 - 0
applications/commons/commons-server/src/main/resources/application.yml

@@ -18,6 +18,7 @@ spring:
       connection-timeout: 30000
   messages:
     basename: i18n/messages
+    encoding: UTF-8
   rabbitmq:
     host: 192.168.0.176
     port: 5672

+ 0 - 0
applications/commons/commons-server/src/main/resources/i18n/messages.properties


+ 117 - 0
applications/commons/commons-server/src/main/resources/i18n/messages_zh_CN.properties

@@ -0,0 +1,117 @@
+#MessageLog
+msg.detail=&nbsp;&nbsp;\u660e\u7ec6\u884c:
+msg.save=\u4fdd\u5b58\u64cd\u4f5c 
+msg.delete=\u5220\u9664\u64cd\u4f5c
+msg.update=\u4fee\u6539\u64cd\u4f5c
+msg.commit=\u63d0\u4ea4\u64cd\u4f5c
+msg.resCommit=\u53cd\u63d0\u4ea4\u64cd\u4f5c
+msg.reply=\u56de\u590d\u5355\u636e
+msg.audit=\u5ba1\u6838\u64cd\u4f5c
+msg.resAudit=\u53cd\u5ba1\u6838\u64cd\u4f5c
+msg.resHung=\u89e3\u6302\u64cd\u4f5c
+msg.check=\u6838\u5bf9\u5355\u636e
+msg.print=\u6253\u5370\u5355\u636e
+msg.banned=\u7981\u7528\u64cd\u4f5c
+msg.resBanned=\u53cd\u7981\u7528\u64cd\u4f5c
+msg.hung=\u6302\u8d77\u64cd\u4f5c
+msg.qty.out=&nbsp;&nbsp;\u8f6c\u51fa\u6570\u91cf
+msg.qty.in=&nbsp;&nbsp;\u8f6c\u5165\u6570\u91cf
+msg.modify=\u66f4\u65b0\u6570\u636e
+msg.modifyDetail=\u66f4\u65b0\u660e\u7ec6\u6570\u636e
+msg.printMT=\u591a\u6b21\u6253\u5370
+msg.printMTSuccess=\u591a\u6b21\u6253\u5370\u6210\u529f
+msg.saveSuccess=\u4fdd\u5b58\u6210\u529f
+msg.deleteSuccess=\u5220\u9664\u6210\u529f
+msg.updateSuccess=\u4fee\u6539\u6210\u529f
+msg.commitSuccess=\u63d0\u4ea4\u6210\u529f
+msg.resCommitSuccess=\u53cd\u63d0\u4ea4\u6210\u529f
+msg.replySuccess=\u56de\u590d\u6210\u529f
+msg.auditSuccess=\u5ba1\u6838\u6210\u529f
+msg.resAuditSuccess=\u53cd\u5ba1\u6838\u6210\u529f
+msg.hungSuccess=\u6302\u8d77\u6210\u529f
+msg.resHungSuccess=\u89e3\u6302\u6210\u529f
+msg.checkSuccess=\u6838\u5bf9\u6210\u529f
+msg.printSuccess=\u6253\u5370\u6210\u529f
+msg.bannedSuccess=\u7981\u7528\u6210\u529f
+msg.resBannedSuccess=\u53cd\u7981\u7528\u6210\u529f
+msg.modifySuccess=\u6570\u636e\u66f4\u65b0\u6210\u529f
+msg.modifyDetailSuccess=\u66f4\u65b0\u660e\u7ec6\u6570\u636e\u6210\u529f
+msg.post=\u8fc7\u8d26\u64cd\u4f5c
+msg.openMrp=\u6253\u5f00Mrp
+msg.openMrpSuccess=\u6253\u5f00Mrp\u6210\u529f\uff01
+msg.closeMrp=\u5173\u95edMrp
+msg.closeMrpSuccess=\u5173\u95edMrp\u6210\u529f\uff01
+msg.resPost=\u53cd\u8fc7\u8d26\u64cd\u4f5c
+msg.postSuccess=\u8fc7\u8d26\u6210\u529f
+msg.resPostSuccess=\u53cd\u8fc7\u8d26\u6210\u529f
+msg.account=\u8bb0\u8d26\u64cd\u4f5c
+msg.resAccount=\u53cd\u8bb0\u8d26\u64cd\u4f5c
+msg.accountSuccess=\u8bb0\u8d26\u6210\u529f
+msg.resAccountSuccess=\u53d6\u6d88\u8bb0\u8d26\u6210\u529f
+msg.freeze=\u51bb\u7ed3\u64cd\u4f5c
+msg.freezeSuccess=\u51bb\u7ed3\u6210\u529f
+msg.resFreeze=\u53d6\u6d88\u51bb\u7ed3\u64cd\u4f5c
+msg.resFreezeSuccess=\u53d6\u6d88\u51bb\u7ed3\u6210\u529f
+msg.resStart=\u91cd\u542f\u64cd\u4f5c
+msg.resStartSuccess=\u91cd\u542f\u6210\u529f
+msg.close=\u7ed3\u6848\u64cd\u4f5c
+msg.closeSuccess=\u7ed3\u6848\u6210\u529f
+msg.resClose=\u53d6\u6d88\u7ed3\u6848\u64cd\u4f5c
+msg.resCloseSuccess=\u53d6\u6d88\u7ed3\u6848\u6210\u529f
+msg.turnPurchase=\u8f6c\u91c7\u8d2d\u5355\u64cd\u4f5c
+msg.turnMake=\u8f6c\u5236\u9020\u5355\u64cd\u4f5c
+msg.turnOutSource=\u8f6c\u59d4\u5916\u5355\u64cd\u4f5c
+msg.turnCustomer=\u8f6c\u5ba2\u6237\u64cd\u4f5c
+msg.turnFKCustomer=\u5b8c\u5584\u98ce\u63a7\u8d44\u6599
+msg.turnFKSuccess=\u5df2\u5b8c\u5584\u98ce\u63a7\u8d44\u6599
+msg.turnAcceptNotify=\u8f6c\u6536\u6599\u901a\u77e5\u5355\u64cd\u4f5c
+msg.turnProdIO\!SaleReturn=\u8f6c\u9500\u552e\u9000\u8d27\u64cd\u4f5c
+msg.turnVerifyApply=\u8f6c\u6536\u6599\u5355
+msg.turnSuccess=\u8f6c\u5355\u6210\u529f
+msg.submit=\u63d0\u4ea4\u64cd\u4f5c
+msg.submitSuccess=\u63d0\u4ea4\u6210\u529f
+msg.VerifyApplyDetailOQC=\u8f6c\u5ba2\u6237\u9a8c\u8d27\u5355\u6210\u529f
+msg.resSubmit=\u53cd\u63d0\u4ea4\u64cd\u4f5c
+msg.resSubmitSuccess=\u53cd\u63d0\u4ea4\u6210\u529f
+msg.turnVendor=\u8f6c\u4f9b\u5e94\u5546\u64cd\u4f5c
+msg.turnPayBalance=\u8f6c\u4ed8\u6b3e\u5355\u64cd\u4f5c
+msg.turnRecBalance=\u8f6c\u6536\u6b3e\u5355\u64cd\u4f5c
+msg.turnSale=\u8f6c\u9500\u552e\u5355\u64cd\u4f5c
+msg.turnPurcPrice=\u8f6c\u6838\u4ef7\u5355
+msg.turnRepairOrder=\u8f6c\u6d3e\u5de5\u5355
+msg.turnProdIN=\u8f6c\u51fa\u8d27\u5355\u64cd\u4f5c
+msg.end=\u7ed3\u6848\u64cd\u4f5c
+msg.endSuccess=\u7ed3\u6848\u6210\u529f
+msg.resEnd=\u53cd\u7ed3\u6848\u64cd\u4f5c
+msg.nullify=\u4f5c\u5e9f\u64cd\u4f5c
+msg.nullifySuccess=\u4f5c\u5e9f\u6210\u529f
+msg.turnRecruitment=\u8f6c\u62db\u8058\u8ba1\u5212
+msg.turnRecruitmentsuccess=\u8f6c\u62db\u8058\u8ba1\u5212\u6210\u529f
+msg.resEndSuccess=\u53cd\u7ed3\u6848\u6210\u529f
+msg.turnARBill=\u5f00\u7968\u4f5c\u4e1a
+msg.turnNotify=\u8f6c\u901a\u77e5\u5355\u64cd\u4f5c
+msg.turnStorage=\u8f6c\u5165\u5e93
+msg.turnProdIO=\u8f6c\u51fa\u5e93\u5355\u64cd\u4f5c
+msg.turnProdIO\!OtherOut=\u8f6c\u5176\u5b83\u51fa\u5e93\u5355\u64cd\u4f5c
+msg.turnProdIO\!OtherPurcOut=\u8f6c\u5176\u5b83\u91c7\u8d2d\u51fa\u5e93\u5355
+msg.turnSendNotify=\u8f6c\u53d1\u8d27\u901a\u77e5\u5355\u64cd\u4f5c
+msg.turnSaleReturn=\u8f6c\u9500\u552e\u9000\u8d27\u5355
+msg.approve=\u6279\u51c6\u64cd\u4f5c
+msg.approveSuccess=\u6279\u51c6\u6210\u529f
+msg.resApprove=\u53cd\u6279\u51c6\u64cd\u4f5c
+msg.resApproveSuccess=\u53cd\u6279\u51c6\u6210\u529f
+msg.turnEmployee=\u8f6c\u8bd5\u7528\u4eba\u5458
+msg.turnEmployeeSuccess=\u8f6c\u8bd5\u7528\u4eba\u5458\u6210\u529f
+msg.turnBuglist=\u8f6cbuglist\u6210\u529f
+msg.changeSeller=\u4e1a\u52a1\u5458\u8f6c\u79fb\u64cd\u4f5c 
+msg.changeSellerSuccess=\u4e1a\u52a1\u5458\u8f6c\u79fb\u6210\u529f
+msg.confirm=\u786e\u8ba4
+msg.confirmSuccess=\u786e\u8ba4\u6210\u529f
+msg.resConfirm=\u53cd\u786e\u8ba4\u64cd\u4f5c
+msg.resConfirmSuccess=\u53cd\u786e\u8ba4\u6210\u529f
+msg.Copy=\u590d\u5236\u64cd\u4f5c
+msg.CopySuccess=\u590d\u5236\u6210\u529f,\u6765\u6e90\u5355\u53f7\uff1a
+msg.getBill=\u83b7\u53d6\u53d1\u7968\u660e\u7ec6
+msg.getARBill=\u83b7\u53d6\u5e94\u6536\u53d1\u7968
+msg.getAPBill=\u83b7\u53d6\u5e94\u4ed8\u53d1\u7968
+msg.getSuccess=\u83b7\u53d6\u6210\u529f

+ 307 - 0
applications/commons/commons-server/src/main/resources/mapper/MessagelogMapper.xml

@@ -0,0 +1,307 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.usoftchina.saas.commons.mapper.MessagelogMapper" >
+  <resultMap id="BaseResultMap" type="com.usoftchina.saas.commons.po.Messagelog" >
+    <id column="ml_id" property="id" jdbcType="INTEGER" />
+    <result column="ml_code" property="ml_code" jdbcType="VARCHAR" />
+    <result column="ml_content" property="ml_content" jdbcType="VARCHAR" />
+    <result column="ml_result" property="ml_result" jdbcType="VARCHAR" />
+    <result column="ml_caller" property="ml_caller" jdbcType="VARCHAR" />
+    <result column="ml_man" property="ml_man" jdbcType="VARCHAR" />
+    <result column="companyId" property="companyId" jdbcType="INTEGER" />
+    <result column="createTime" property="createTime" jdbcType="TIMESTAMP" />
+    <result column="creatorId" property="creatorId" jdbcType="INTEGER" />
+    <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
+    <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
+    <result column="ml_keyvalue" property="ml_keyvalue" jdbcType="INTEGER" />
+  </resultMap>
+  <sql id="Example_Where_Clause" >
+    <where >
+      <foreach collection="oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause" >
+    <where >
+      <foreach collection="example.oredCriteria" item="criteria" separator="or" >
+        <if test="criteria.valid" >
+          <trim prefix="(" suffix=")" prefixOverrides="and" >
+            <foreach collection="criteria.criteria" item="criterion" >
+              <choose >
+                <when test="criterion.noValue" >
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue" >
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue" >
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue" >
+                  and ${criterion.condition}
+                  <foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List" >
+    ml_id, ml_code, ml_content, ml_result, ml_caller, ml_man, companyId, createTime, 
+    creatorId, updateTime, updaterId
+  </sql>
+  <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.usoftchina.saas.commons.po.MessagelogExample" >
+    select
+    <if test="distinct" >
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from messagelog
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null" >
+      order by ${orderByClause}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+    select 
+    <include refid="Base_Column_List" />
+    from messagelog
+    where ml_id = #{id,jdbcType=INTEGER}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+    delete from messagelog
+    where ml_id = #{id,jdbcType=INTEGER}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.usoftchina.saas.commons.po.MessagelogExample" >
+    delete from messagelog
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.usoftchina.saas.commons.po.Messagelog" >
+    insert into messagelog ( ml_code, ml_content,
+      ml_result, ml_caller, ml_man, 
+      companyId, createTime, creatorId, 
+      updateTime, updaterId,ml_keyvalue)
+    values (#{ml_code,jdbcType=VARCHAR}, #{ml_content,jdbcType=VARCHAR},
+      #{ml_result,jdbcType=VARCHAR}, #{ml_caller,jdbcType=VARCHAR}, #{ml_man,jdbcType=VARCHAR}, 
+      #{companyId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{creatorId,jdbcType=INTEGER}, 
+      #{updateTime,jdbcType=TIMESTAMP}, #{updaterId,jdbcType=INTEGER},#{ml_keyvalue,jdbcType=INTEGER})
+  </insert>
+  <insert id="insertSelective" parameterType="com.usoftchina.saas.commons.po.Messagelog" >
+    insert into messagelog
+    <trim prefix="(" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        ml_id,
+      </if>
+      <if test="ml_code != null" >
+        ml_code,
+      </if>
+      <if test="ml_content != null" >
+        ml_content,
+      </if>
+      <if test="ml_result != null" >
+        ml_result,
+      </if>
+      <if test="ml_caller != null" >
+        ml_caller,
+      </if>
+      <if test="ml_man != null" >
+        ml_man,
+      </if>
+      <if test="companyId != null" >
+        companyId,
+      </if>
+      <if test="createTime != null" >
+        createTime,
+      </if>
+      <if test="creatorId != null" >
+        creatorId,
+      </if>
+      <if test="updateTime != null" >
+        updateTime,
+      </if>
+      <if test="updaterId != null" >
+        updaterId,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides="," >
+      <if test="id != null" >
+        #{id,jdbcType=INTEGER},
+      </if>
+      <if test="ml_code != null" >
+        #{ml_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_content != null" >
+        #{ml_content,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_result != null" >
+        #{ml_result,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_caller != null" >
+        #{ml_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_man != null" >
+        #{ml_man,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        #{updaterId,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.usoftchina.saas.commons.po.MessagelogExample" resultType="java.lang.Integer" >
+    select count(*) from messagelog
+    <if test="_parameter != null" >
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map" >
+    update messagelog
+    <set >
+      <if test="record.id != null" >
+        ml_id = #{record.id,jdbcType=INTEGER},
+      </if>
+      <if test="record.ml_code != null" >
+        ml_code = #{record.ml_code,jdbcType=VARCHAR},
+      </if>
+      <if test="record.ml_content != null" >
+        ml_content = #{record.ml_content,jdbcType=VARCHAR},
+      </if>
+      <if test="record.ml_result != null" >
+        ml_result = #{record.ml_result,jdbcType=VARCHAR},
+      </if>
+      <if test="record.ml_caller != null" >
+        ml_caller = #{record.ml_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="record.ml_man != null" >
+        ml_man = #{record.ml_man,jdbcType=VARCHAR},
+      </if>
+      <if test="record.companyId != null" >
+        companyId = #{record.companyId,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null" >
+        createTime = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.creatorId != null" >
+        creatorId = #{record.creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="record.updateTime != null" >
+        updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updaterId != null" >
+        updaterId = #{record.updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map" >
+    update messagelog
+    set ml_id = #{record.id,jdbcType=INTEGER},
+      ml_code = #{record.ml_code,jdbcType=VARCHAR},
+      ml_content = #{record.ml_content,jdbcType=VARCHAR},
+      ml_result = #{record.ml_result,jdbcType=VARCHAR},
+      ml_caller = #{record.ml_caller,jdbcType=VARCHAR},
+      ml_man = #{record.ml_man,jdbcType=VARCHAR},
+      companyId = #{record.companyId,jdbcType=INTEGER},
+      createTime = #{record.createTime,jdbcType=TIMESTAMP},
+      creatorId = #{record.creatorId,jdbcType=INTEGER},
+      updateTime = #{record.updateTime,jdbcType=TIMESTAMP},
+      updaterId = #{record.updaterId,jdbcType=INTEGER}
+    <if test="_parameter != null" >
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.commons.po.Messagelog" >
+    update messagelog
+    <set >
+      <if test="ml_code != null" >
+        ml_code = #{ml_code,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_content != null" >
+        ml_content = #{ml_content,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_result != null" >
+        ml_result = #{ml_result,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_caller != null" >
+        ml_caller = #{ml_caller,jdbcType=VARCHAR},
+      </if>
+      <if test="ml_man != null" >
+        ml_man = #{ml_man,jdbcType=VARCHAR},
+      </if>
+      <if test="companyId != null" >
+        companyId = #{companyId,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null" >
+        createTime = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="creatorId != null" >
+        creatorId = #{creatorId,jdbcType=INTEGER},
+      </if>
+      <if test="updateTime != null" >
+        updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updaterId != null" >
+        updaterId = #{updaterId,jdbcType=INTEGER},
+      </if>
+    </set>
+    where ml_id = #{id,jdbcType=INTEGER}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.commons.po.Messagelog" >
+    update messagelog
+    set ml_code = #{ml_code,jdbcType=VARCHAR},
+      ml_content = #{ml_content,jdbcType=VARCHAR},
+      ml_result = #{ml_result,jdbcType=VARCHAR},
+      ml_caller = #{ml_caller,jdbcType=VARCHAR},
+      ml_man = #{ml_man,jdbcType=VARCHAR},
+      companyId = #{companyId,jdbcType=INTEGER},
+      createTime = #{createTime,jdbcType=TIMESTAMP},
+      creatorId = #{creatorId,jdbcType=INTEGER},
+      updateTime = #{updateTime,jdbcType=TIMESTAMP},
+      updaterId = #{updaterId,jdbcType=INTEGER}
+    where ml_id = #{id,jdbcType=INTEGER}
+  </update>
+</mapper>

+ 5 - 5
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/controller/PurchaseController.java

@@ -4,7 +4,7 @@ import com.github.pagehelper.PageInfo;
 import com.usoftchina.saas.base.Result;
 
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.*;
 import com.usoftchina.saas.purchase.po.PurchaseList;
@@ -57,9 +57,9 @@ public class PurchaseController {
      * @return
      */
     @PostMapping("/save")
-    public Result<DocSavedDTO> saveFormData(@RequestBody PurchaseFormDTO data) {
-        DocSavedDTO savedDTO = purchaseService.saveFormData(data);
-        return Result.success(savedDTO);
+    public Result<DocBaseDTO> saveFormData(@RequestBody PurchaseFormDTO data) {
+        DocBaseDTO save = purchaseService.saveFormData(data);
+        return Result.success(save);
 
     }
 
@@ -95,7 +95,7 @@ public class PurchaseController {
      */
     @PostMapping("/audit")
     public Result audit(@RequestBody PurchaseFormDTO formData) {
-        DocSavedDTO audit = purchaseService.audit(formData);
+        DocBaseDTO audit = purchaseService.audit(formData);
         return Result.success(audit);
     }
 

+ 2 - 0
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/mapper/PurchaseMapper.java

@@ -26,4 +26,6 @@ public interface PurchaseMapper extends CommonBaseMapper<Purchase>{
     Integer validateCodeWhenInsert(String code);
 
     Integer validateCodeWhenUpdate(@Param("code") String code,@Param("id") Long id);
+
+    String selectCodeById(Long id);
 }

+ 3 - 2
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/PurchaseService.java

@@ -6,6 +6,7 @@ import com.usoftchina.saas.base.service.CommonBaseService;
 
 
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
 import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.page.PageRequest;
 import com.usoftchina.saas.purchase.dto.PurchaseFormDTO;
@@ -49,7 +50,7 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
      * @param formdata
      * @return
      */
-    DocSavedDTO saveFormData(PurchaseFormDTO formdata);
+    DocBaseDTO saveFormData(PurchaseFormDTO formdata);
 
     /**
      * 删除
@@ -73,7 +74,7 @@ public interface PurchaseService extends CommonBaseService<PurchaseMapper, Purch
      * @param formData
      * @return
      */
-    DocSavedDTO audit(PurchaseFormDTO formData);
+    DocBaseDTO audit(PurchaseFormDTO formData);
 
     /**
     * @Description 批量审核

+ 58 - 15
applications/purchase/purchase-server/src/main/java/com/usoftchina/saas/purchase/service/impl/PurchaseServiceImpl.java

@@ -7,9 +7,9 @@ import com.usoftchina.saas.base.Result;
 import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
 
 import com.usoftchina.saas.commons.api.MaxnumberService;
+import com.usoftchina.saas.commons.api.MessageLogService;
 import com.usoftchina.saas.commons.dto.BatchDealBaseDTO;
 import com.usoftchina.saas.commons.dto.DocBaseDTO;
-import com.usoftchina.saas.commons.dto.DocSavedDTO;
 import com.usoftchina.saas.commons.exception.BizExceptionCode;
 import com.usoftchina.saas.context.BaseContextHolder;
 import com.usoftchina.saas.document.api.ProductApi;
@@ -52,6 +52,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     private ProdInOutMapper prodInOutMapper;
     @Autowired
     private ProdIODetailMapper prodIODetailMapper;
+    @Autowired
+    private MessageLogService messageLogService;
 
     @Override
     public PageInfo<PurchaseList> getListData(PageRequest page, PurchaseReqDTO req) {
@@ -85,7 +87,7 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
     }
 
     @Override
-    public DocSavedDTO saveFormData(PurchaseFormDTO formdata) {
+    public DocBaseDTO saveFormData(PurchaseFormDTO formdata) {
         if (null == formdata || null == formdata.getMain()){
             throw new BizException(500, "数据为空,请填写后再保存");
         }
@@ -100,7 +102,8 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         List<PurchaseDetail> insertDetails = new ArrayList<>();
         //更新从表数据
         List<PurchaseDetail> updateDetails = new ArrayList<>();
-        DocSavedDTO saveDTO = new DocSavedDTO();
+        //返回对象
+        DocBaseDTO baseDTO = null;
         Long pu_id = main.getId();
         String pu_code = main.getPu_code();
         Purchase purchase = BeanMapper.map(main, Purchase.class);
@@ -111,7 +114,6 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         //编号校验
         pu_code = pushMaxnubmer(pu_code, pu_id);
         purchase.setPu_code(pu_code);
-        saveDTO.setCode(pu_code);
         //判断更新与保存动作
         if (StringUtils.isEmpty(pu_id) || "0".equals(pu_id.toString())) {
             //插入操作
@@ -128,8 +130,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             if (insertDetails.size() > 0) {
                 purchasedetailMapper.batchInsert(insertDetails);
             }
-            saveDTO.setId(pu_id);
-            return saveDTO;
+            baseDTO = getBaseDTOById(pu_id);
+            //日志记录
+            messageLogService.save(baseDTO);
+            return baseDTO;
         }
         //更新操作
         purchaseMapper.updateByPrimaryKeySelective(purchase);
@@ -152,8 +156,10 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         if (updateDetails.size() > 0) {
             purchasedetailMapper.batchUpdate(updateDetails);
         }
-        saveDTO.setId(pu_id);
-        return saveDTO;
+        baseDTO = getBaseDTOById(pu_id);
+        //日志
+        messageLogService.save(baseDTO);
+        return baseDTO;
 
     }
 
@@ -164,23 +170,26 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
 
     @Override
     public int deleteDetail(Long id) {
-        return purchasedetailMapper.deleteByPrimaryKey(id);
+       Integer num = purchasedetailMapper.deleteByPrimaryKey(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+        messageLogService.deleteDetail(docBaseDTO);
+        return num;
     }
 
     @Override
-    public DocSavedDTO audit(PurchaseFormDTO formData) {
+    public DocBaseDTO audit(PurchaseFormDTO formData) {
         Long id = null;
-        DocSavedDTO savedDTO = new DocSavedDTO();
+        DocBaseDTO baseDTO = null;
         if (null != formData) {
             id = formData.getMain().getId();
             if (StringUtils.isEmpty(id) || "0".equals(String.valueOf(id))) {
-                DocSavedDTO saveDTO = saveFormData(formData);
-                id = saveDTO.getId();
+                baseDTO = saveFormData(formData);
+                id = baseDTO.getId();
             }
             singleAudit(id);
         }
-        savedDTO.setId(id);
-        return savedDTO;
+        return baseDTO;
     }
 
     @Override
@@ -246,6 +255,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchase.setPu_acceptstatuscode("CLOSED");
         purchase.setPu_acceptstatus("已关闭");
         purchaseMapper.updateByPrimaryKeySelective(purchase);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+        messageLogService.close(docBaseDTO);
     }
 
     @Override
@@ -277,6 +289,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchase.setPu_acceptstatuscode("TURNIN");
             }
             purchaseMapper.updateByPrimaryKeySelective(purchase);
+            DocBaseDTO docBaseDTO = getBaseDTOById(id);
+            //日志
+            messageLogService.open(docBaseDTO);
         }
     }
 
@@ -376,6 +391,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchaseMapper.updateByPrimaryKeySelective(purchase);
         //更新最新采购单价
         //productApi.updateLatestPurchasePrice(id);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+        messageLogService.audit(docBaseDTO);
     }
 
     private void singleUnAudit(Long id) {
@@ -388,6 +406,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
         purchase.setUpdaterId(BaseContextHolder.getUserId());
         //更新存在字段
         purchaseMapper.updateByPrimaryKeySelective(purchase);
+        DocBaseDTO docBaseDTO = getBaseDTOById(id);
+        //日志
+        messageLogService.unAudit(docBaseDTO);
     }
 
     private void singleDelete(Long id) {
@@ -396,6 +417,9 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
             purchasedetailMapper.deleteByForeignKey(id);
             //主表删除
             purchaseMapper.deleteByPrimaryKey(id);
+            DocBaseDTO docBaseDTO = getBaseDTOById(id);
+            //日志
+            messageLogService.delete(docBaseDTO);
         }
     }
 
@@ -424,4 +448,23 @@ public class PurchaseServiceImpl extends CommonBaseServiceImpl<PurchaseMapper, P
                 purchaseMapper.validateCodeWhenUpdate(code, id);
         return maxnumberService.pushMaxnubmer(count, code, "Purchase");
     }
+    
+    /** 
+    * @Description
+    * @Param: [id]
+    * @return: com.usoftchina.saas.commons.dto.DocBaseDTO 
+    * @Author: guq
+    * @Date: 2018/10/22 
+    */
+    private DocBaseDTO getBaseDTOById(Long id) {
+        if (null == id) {
+            return null;
+        }
+        String code = purchaseMapper.selectCodeById(id);
+        DocBaseDTO baseDTO = new DocBaseDTO();
+        baseDTO.setId(id);
+        baseDTO.setCode(code);
+        baseDTO.setName("Purchase");
+        return baseDTO;
+    }
 }

+ 3 - 0
applications/purchase/purchase-server/src/main/resources/mapper/PurchaseMapper.xml

@@ -419,4 +419,7 @@
   <select id="validateCodeWhenUpdate" resultType="int" >
     select count(1) from purchase where pu_code = #{code} and pu_id != #{id}
   </select>
+  <select id="selectCodeById" resultType="string" parameterType="long">
+    select pu_code from pu_id=#{id}
+  </select>
 </mapper>