Quellcode durchsuchen

Merge remote-tracking branch 'origin/dev/one' into dev/one

zhaops vor 6 Jahren
Ursprung
Commit
59f4fe9855

+ 8 - 2
diagbotman-service/src/main/java/com/diagbot/facade/LantoneProductFacade.java

@@ -46,9 +46,9 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
      */
     public Boolean addProducts(AddProductsVO addProductsVO) {
         LantoneProduct lantoneProduct =new LantoneProduct();
+        BeanUtil.copyProperties(addProductsVO,lantoneProduct);
         lantoneProduct.setGmtCreate(DateUtil.now());
         lantoneProduct.setCreator(UserUtils.getCurrentPrincipleID());
-        BeanUtil.copyProperties(addProductsVO,lantoneProduct);
         if (!save(lantoneProduct)) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "产品添加失败");
@@ -64,6 +64,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
     public Boolean updateProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct =this.getById(updateProductVO.getId());
         BeanUtil.copyProperties(updateProductVO,lantoneProduct);
+        lantoneProduct.setGmtModified(DateUtil.now());
+        lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
         if (!updateById(lantoneProduct)) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "产品修改失败");
@@ -77,7 +79,9 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
      */
     public Boolean deleteProduct(UpdateProductVO updateProductVO) {
         LantoneProduct lantoneProduct = getById(updateProductVO.getId());
-        lantoneProduct.setIsDeleted(IsDeleteEnum.Y.getName());
+        lantoneProduct.setIsDeleted(IsDeleteEnum.Y.getKey());
+        lantoneProduct.setGmtModified(DateUtil.now());
+        lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
         if (!updateById(lantoneProduct)) {
             throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
                     "产品删除失败");
@@ -91,6 +95,8 @@ public class LantoneProductFacade extends LantoneProductServiceImpl {
      * @Date: 19:59 2018/9/18
      */
     public Boolean productStatus(LantoneProduct lantoneProduct) {
+        lantoneProduct.setGmtModified(DateUtil.now());
+        lantoneProduct.setModifier(UserUtils.getCurrentPrincipleID());
         if (!updateById(lantoneProduct)) {
             throw new CommonException(CommonErrorCode.FAIL);
         }