Commit f5319703 authored by 廖旭伟's avatar 廖旭伟

修改bug

parent 2f76e57b
......@@ -10,6 +10,7 @@ import com.mortals.xhx.module.customer.model.CustomerWorkDesignEntity;
import com.mortals.xhx.module.customer.service.CustomerWorkCollectService;
import com.mortals.xhx.module.masterplate.model.MasterplateUseInfoEntity;
import com.mortals.xhx.module.masterplate.service.MasterplateUseInfoService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -36,5 +37,12 @@ public class CustomerWorkCollectServiceImpl extends AbstractCRUDServiceImpl<Cust
protected void saveBefore(CustomerWorkCollectEntity entity, Context context) throws AppException {
this.validData(entity, context);
entity.setCustomerId(this.getContextUserId(context));
CustomerWorkCollectEntity query = new CustomerWorkCollectEntity();
query.setCustomerId(entity.getCustomerId());
query.setMasterplateId(entity.getMasterplateId());
List<CustomerWorkCollectEntity> list = this.find(query);
if(CollectionUtils.isNotEmpty(list)){
throw new AppException("已收藏此模板,请勿重复收藏");
}
}
}
\ No newline at end of file
......@@ -47,9 +47,9 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
}
@Override
public Rest<Map<String, Object>> list(@RequestBody(required = false) CustomerEntity query) {
public Rest<Object> list(@RequestBody(required = false) CustomerEntity query) {
Map<String, Object> model = new HashMap();
Rest<Map<String, Object>> ret = new Rest();
Rest<Object> ret = new Rest();
Context context = this.getContext();
String busiDesc = "查询" + this.getModuleDesc();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment