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